therealwesfoster Posted May 30, 2008 Share Posted May 30, 2008 I have several ID's on my page. Example: <span id="Ship_1">stuff1</span> <span id="Ship_2">stuff2</span> <span id="Ship_3">stuff3</span> I'm wanting to select all of the elements starting with Ship_ and work with them. The reason is, because the numbers will not always be predicable like it is above. Maybe something like this (I'm using an SQL % to show an example of what I need)? var ships = document.getElementById("Ship_%"); alert(ships[0].innerHTML); Which would show stuff1 Thanks Link to comment https://forums.phpfreaks.com/topic/107929-get-elements-starting-with/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.