Jump to content

[SOLVED] Changing Node Values


Recommended Posts

Some HTML

<div class='news'>
	<b class="news-head">News Flash: New Website by Guardian Technology </b>
	<br />
	<span class="news-subhead">Date: 2007-05-01</span>
	<br />

	<span class="news-subhead">New Website Again...OMG!</span>
	<br />
	<img style="border:0" src="images/default.bmp" width="200" height="133" alt="Jordan 2 Picture" />
	<br />
	Thanks to Brandon Wamboldt From Guardian Technolog...<br />
	<span id="span1" class="readmore" style="cursor:pointer;" onclick="toggleDisplay('news1','span1')">
	>>Read More</span>

	<div style="display:none" id="news1"><p class="news-body">
	Thanks to Brandon Wamboldt From Guardian Technology: Freelance Web Development, we have yet another new site. Hope you all like this one.
	</p></div>
	</div>
	 <div class='news'>
	<b class="news-head">News Flash: Jordan Wilkens 2 Trailer  </b>
	<br />
	<span class="news-subhead">Date: 2007-04-04</span>

	<br />
	<span class="news-subhead">WHAT?! JORDAN AGAIN!?!? NOOOOOOOOO!!!!!!!!</span>
	<br />
	<img style="border:0" src="images/jordan2trailer.jpg " width="200" height="133" alt="Jordan 2 Picture" />
	<br />
	We just released the Jordan Wilkens 2 Trailer on Y...<br />
	<span id="span2" class="readmore" style="cursor:pointer;" onclick="toggleDisplay('news2','span2')">
	>>Read More</span>

	<div style="display:none" id="news2"><p class="news-body">
	We just released the Jordan Wilkens 2 Trailer on Youtube. Go ahead and check it out. The movie stars Jordan Wilkens as Jordan Wilkens. Please vote for the new movie.
	</p></div>
	</div>
	  
</div>

 

Now I need it so when I click on Read More it changes ">>Read More" to "<<Hide All"

 

Javascript so far:

<!--
function toggleDisplay(which,other)
{
var myId = document.getElementById(which);
var otherID = document.getElementById(other);

if (myId.style.display=="block")
{
	myId.style.display="none";
	otherID.nodeValue=">>Read More";
}
else if (myId.style.display=="none")
{
	myId.style.display="block";
	otherID.nodeValue="<<Hide All";
}
}
-->

You can look at the site at

http://ictonentertainment.com/wamboldt/newicton/

Link to comment
https://forums.phpfreaks.com/topic/50069-solved-changing-node-values/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.