Jump to content

Modifying contents of an HTML div tag


phpcodeaddict

Recommended Posts

PHP newbie question :)

 

I have some HTML with a div tag and i want to be able to use PHP to create the contents of the div tag.

 

E.g. My HTML is;

 

<div id="bodyHTML">Insert main body HTML here</div>

 

And i want to use PHP to get access that div by the id and then

replace the 'Insert main body HTML here' with some HTML generated

from my PHP script

 

Can anyone tell me how i can do this in PHP?

 

Thanks

 

 

Link to comment
https://forums.phpfreaks.com/topic/136998-modifying-contents-of-an-html-div-tag/
Share on other sites

I'm not sure what exactly you are trying to achieve bout it sounds like you might want to use javascript.

 

That is if you want to edit the contents of the DIV based on the id tag alone.

 

You could so something like:

 

<div id="bodyHTML"><?=$bodyHTML ?></div>

but that don't sound to me what you are trying to do.

 

More information would help.

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.