ricmetal Posted March 10, 2009 Share Posted March 10, 2009 i have an editable div, which is supposed to be edited. when user clicks outside it i need to retreive edit the div's id. i have many divs with the same id, so i cant getElementById Quote Link to comment Share on other sites More sharing options...
.josh Posted March 10, 2009 Share Posted March 10, 2009 name and id are two different things. if each div has its own id (and it should), you can use getElementById Quote Link to comment Share on other sites More sharing options...
ricmetal Posted March 10, 2009 Author Share Posted March 10, 2009 sorry, no names here i meant to say id all divs have the same id. why shouldnt they? is there any other con besides being unable to call the one i want? the divs are created dynamiclly, and itll be a mess to dymanicly set their id cause they will constantly be created and deleted Quote Link to comment Share on other sites More sharing options...
ricmetal Posted March 10, 2009 Author Share Posted March 10, 2009 wait, not making sense here yeah, i need to get the text inside the selected div, and as the divs have the same id i cant use getElementById so how can i get the info from within a div based on it being selected? plus, because its dynamicly created i dont know it's id... Quote Link to comment Share on other sites More sharing options...
ricmetal Posted March 10, 2009 Author Share Posted March 10, 2009 ok, i got around this, setting a diffrent id (easier than i previously thought) and getting the id from each div 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.