![]() |
Help needed with Javascript I need a javascript code to write the id of the div where the code is placed. For example: <div id="div1"><script type="text/javascript">.....</script></div> The code will write: div1 And when i change the id of the div the code will write the new id please help me :) |
Re: Help needed with Javascript document.getElementById("div1").innerHtml = ""; I think that should do. Am not sure. Prateek PDJSolutions |
Re: Help needed with Javascript the problem is i don`t know the div id beacause i want to use this code for comments on a blog , each comment has a different div id |
Re: Help needed with Javascript Because Js is clientside only and your looking to create a unique reference for each div presumably from different client machines, I think that the only way todo this will be to grab your div number from a database or maybe server based text file using an ajax call, write your div, ++ the div number then write it back to the server once again using an ajax call. As ever nothing is simple :) . |
| All times are GMT -6. The time now is 02:03 AM. |