ssjal Posted September 6, 2011 Share Posted September 6, 2011 hi, i am updating records from database using ajax and javascript on php page. The result is displayed inside a div (<div id="show"></div>). Now i want to assign the content of the above div(say y) to php variable for further calculations. How can i assign the value displayed in div tag to a php variable? Thanks. Link to comment https://forums.phpfreaks.com/topic/246543-assigning-div-content-to-php-variable/ Share on other sites More sharing options...
WebStyles Posted September 6, 2011 Share Posted September 6, 2011 Since you're already using ajax, this should be easy for you. You can grab the content with javascript using something like: var content = document.getElementById("DIVNAME").innerHTML; then use ajax to post it to a php script for processing. Link to comment https://forums.phpfreaks.com/topic/246543-assigning-div-content-to-php-variable/#findComment-1266228 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.