|
|||
Hi, I'm having some problem with innerHTML. I was able to enter content into innerHTML with javascript. But how do I clear the innerHTML content and enter another new content? Below is the example problem
-------------------------------------------------------------------------- <div id="testing"></div> <script type="text/javascript"> function show1() { document.getElementById('testing').innerHTML = "Hello World"; } function show2() { document.getElementById('testing').innerHTML = "Goodbye World"; } </script> <input type="button" value="show1" onmousedown="javascript:show1();" /> <input type="button" value="show1" onmousedown="javascript:show2();" /> -------------------------------------------------------------------------- When I try it, it ended up showing "Hello WorldGoodby World" if I press "show1" then press "show2". How can I clear the content before enter new content in innerHTML? |
|
|||
![]() |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| javascript + php | tenuk | Website Programming | 3 | 11-12-2006 09:32 AM |
| HTML & JavaScript | marcoenie | Website Design | 8 | 15-02-2006 12:03 PM |
| import javascript | honeyz | Website Design | 1 | 27-09-2005 10:09 AM |
| javascript question | kelly001 | Website Design | 0 | 22-07-2003 01:20 AM |
| Just some questions about Javascript | ngaisteve1 | Website Design | 1 | 13-02-2003 04:08 PM |
All times are GMT +8. The time now is 12:46 PM.
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.














Linear Mode

