Jump to content

Assigning Div content to php variable


ssjal

Recommended Posts

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

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.

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.