I have this:
<h4 class="modal-title" id="exampleModalLabel"> hello </h4>
and I want to extract the hello word using its id
and assign this to a php var but I don't have an idea. If it were an input it would be easier, but I have to use a different element.
you can use
This returns
hello
.See the fiddle
According to the docs
To assign this to a php variable, please try
UPDATE after seeing
If it were an input would be easier but I have yo use a different element
in your questionUse
document.getElementById('exampleModalLabel').innerHTML
to set the value of a hidden input field and then you can use it as you said in the question.