Skip to content
Advertisement

Update HTML element by title value – Php

I pull HTMl tags from the database. The HTML tag I have captured is as follows:

JavaScript

I find the text with the title “ClassHTML” in the label with PHP and print it on the screen. It works smoothly. What I want to do is to update the text I have drawn. So I want to change the “HTMLTEXT” text. For example, I want it to become:

JavaScript

How can I do that? I am pulling this text with the code below, I want to update this text as I want.

JavaScript

Advertisement

Answer

Not 100% sure if you want this updated after you have echoed it or not. Of you do you will need to do it client side using JS.

If you just want to change what you are echoing , as suggested in the comments change the line

JavaScript

To

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement