Skip to content
WJunction - Webmaster Forum

[JS]Turn back content after changing it.

Status
Not open for further replies.
I used google but didn't find a solution for this one.

Let say i have :

<div id=bla onclick=this.innerHTML='new content'>old content</div>

After the 'bla' is clicked this one must turn back it to 'old content':

<a onclick=??? href=javascript:>Back it</a>

Hope it is fixable .. tnx
 

5 comments

Code:
<div id="div1">
  <p>Content1</p>
</div>
<div id="div2" style="display:none;">
  <p>Content2</p>
</div>
<a href="#" onclick="document.getElementById('div2').style.display = 'block;'>Click me</a>

That works lol, I never suggest something that wouldn't work ;)
 
Ok then...
Here is the thing i want to do actually.

Posted by someone (onclick the bellow replaces it)
Send PM to someone ?
Yes No

if No is clicked it must return back to 'Posted by someone'
if Yes is clicked it must go to other url.

So i am having problem with the No .
How to back the content to 'Posted by someone' ???

The code i am using :
PHP:
echo '<div id=divboss onclick="this.innerHTML=\'Send PM to '.$entry_array[ 'createdby' ][ 'name'].' ?<br /><a href=pm.php?send='.urlencode($entry_array[ 'createdby' ][ 'name']).'>Yes</a> &nbsp &nbsp <a onclick=? href=javascript:>No</a>\';>'.$entry_array[ 'createdby' ][ 'text'].'</div>';
 
Status
Not open for further replies.

About the author

Porsche_maniak
Active Member · Joined
Auto racing,Porsche,Web Development
283
Messages
0
Reactions
16
Points

Advertise on WJunction

Reach 1000's of webmasters, hosts & affiliates. Banner & sponsored-thread slots available.

Contact us
Back
Top Bottom