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();
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