Jump to content

getelementby ??


takn25

Recommended Posts

Hi, I am stuck at this place could some one guide me. For instance I can get the element by id but there are about 10-20 buttons with different Ids and Values so I want to know can I get the element by something that works for all the buttons.


'text='+document.getElementById('8').value;

<button type='submit'  value='8' id='8' onclick="insert();"/> </button>

 

The value and id differ from each other there is another button with different ids and values. So is there something I can come up with that will work for all the buttons?

 

<button type='submit'  value='9' id='9' onclick="insert();"/> </button>

 

 

Link to comment
Share on other sites

Guest
This topic is now 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.