i need help

how can i make it user click join button->change the text "view"

after that user click view btn goes another page

any body plz help me.

this code change text working fine.

function showtext()
  document.getElementById("joinbutton").childNodes[0].nodeValue="View in MyPlans"


 <a href="#" id="joinbutton" class="planpeople" onclick="javascript:showtext()">Join</a>

Recommended Answers

All 2 Replies

If you want to use thesame button for two or more tasks you need to check what the correct text of the button is and then call the needed code based on the button text. E.g. if your button text == "view" then call the redirect code.Is that what you are after?

Why are you using an anchor tag and call it button? Anyway, if you want to only change the display text, you could simply do it as...

<a href="#" class="planpeople" onclick="javascript:this.innerHTML='View in MyPlans'">Join</a>

If you want it to do more than just changing its display text, you may need a function to handle that for cleaner script purpose.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.