Jump to content

document.getElementById simple question


robert_gsfame

Recommended Posts

i really confused with this.. which one is correct

 

onclick=test(document.getElementById('myid').value)

 

how to write the above code correctly in html, php and javascript

 

is it correct if i use this

onclick=test(document.getElementById('myid').value) in html, php and javascript

 

i rather confused with the single and double quotes

 

thx

 

 

Link to comment
https://forums.phpfreaks.com/topic/203180-documentgetelementbyid-simple-question/
Share on other sites

I see no difference between the two?

 

i rather confused with the single and double quotes

 

You can use either, they have no real difference in JavaScript. You just need to make sure you close the string with which ever you opened it with.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.