i have an echo that have this code:
echo' <a href="#" id="adher">Click Here</a> ';
now in java script i need to change the "Click here" in another text....how can i ?
i tryed this...
<script type="text/javascript">
function showStuff(id) {
document.getElementById('adher').innerHTML ="<span style='color:green; font-weight:normal;'>The New Text</span>";
}
</script>
in html page its work
but in
php
its not !
i have a small problem with javascript and php...
Moderator: General Moderators
Re: i have a small problem with javascript and php...
can u please post your PHP code
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: i have a small problem with javascript and php...
I'm not sure if this is helpful but it will work in the html because javascript is processed on the browser (or client side) whereas php has to go to a server (server side) to be processed; if the js code is embedded via php it will work but only if the page is submitted / processed.mekha wrote:in html page its work
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering