Sign in to follow this  

[web] Accessing html in php

This topic is 4034 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Well I believe that the only way to change the innerText property is by using javascript. Using php to change it would only change the initial value which you could do with out php just setting the property when the page loads. But if you have to change using php if you want to value to be dynamically set. I think it would go something like this

<script type="text/javascript">
<?php
$dynamicvalue // set it to what ever value you want
echo "document.getElementById("element").innerText = \"$dynamicvalue\";";
?>

</script>

You change element to how ever you identify the specific tag. And you just got to load this javascript code when the webpage starts by what ever means you want to do this.

Just remember that php only manipulates on the server side so after the html is loaded in the browsers there is no way to manipulate the webpage further by using php

Share this post


Link to post
Share on other sites

This topic is 4034 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this