I would like to know how to access to the php content of a html tag in jQuery. The explanation is as below:
This is my html code:
<div id="edittitle" title="Editing title">
<b><?php $id="a"; ?></b>
</div>
And this is my jQuery code:
$("#table_child_title").on("click", ".editlink", function(event){
var string2=$("#edittitle" ).children('b').contents();
alert(string2);
});
What I want is that when executing the line alert(string2);
the alert window shows me what is between <b>
and </b>
. In other words, it shows exactly the message below:
<?php $id="a"; ?>
Is that possible in jQuery? If yes, what is wrong in my code and what is the right one?
Thanks in advance.