fubz Posted January 13, 2006 Report Share Posted January 13, 2006 on a webpage i have the following:...<span class="redbtext">16</span>...using javascript i want to change the value in there to say: 100I do think this is possible, but i cant figure out how Quote Link to post Share on other sites
jsbowen Posted January 13, 2006 Report Share Posted January 13, 2006 on a webpage i have the following:...<span class="redbtext">16</span>...using javascript i want to change the value in there to say: 100I do think this is possible, but i cant figure out howI'm assuming you want a variable so that you can change the value at any time:<span class="redtext"><script type="text/javascript">var num = 100document.write(num)</script></span> Quote Link to post Share on other sites
fubz Posted January 13, 2006 Author Report Share Posted January 13, 2006 Nope, I dont want to edit any code within those span tags. There is something like innerHTML, but i can't get it to work. But i do think its possible.... Quote Link to post Share on other sites
jsbowen Posted January 15, 2006 Report Share Posted January 15, 2006 I'm confused as to what you want. Did my code not work or are you looking for something different? Quote Link to post Share on other sites
fubz Posted January 15, 2006 Author Report Share Posted January 15, 2006 Your code would wrok perfectly fine if i was able to edit the span tags. But i cannot. Nothing in those span tags can be touched. I need to use JavaScript to edit them. Quote Link to post Share on other sites
jsbowen Posted January 16, 2006 Report Share Posted January 16, 2006 Ah, I see I don't have time to work up the code this morning, but you should be looking for a regular expression in JavaScript for a search and replace. Quote Link to post Share on other sites
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.