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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.