Friday, December 4, 2015

Javascript tips and tricks

You can access a HTML element id by

Type the id name directly in broswer console eg, my div id = makeCall
makeCall
Suppose if id with '_' , like make_Call it won't work

Use getElement, Works in all case
document.getElementById('makeCall')

or Query selector, it doesn't like id with numbers at start :P
document.querySelector('#makeCall')










If you want to use script or a function in HTML form action you can use 'javascript:myFunction();'



action="javascript:myFunction();

No comments:

Post a Comment

CSS tricks

Mixed paint in background: background: linear-gradient(to right, #b6e358, #38b143) Grid view: display: grid; grid-template-columns: a...