get a html element to be a php variable - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:html

Description

get a html element to be a php variable

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
  <title>Insert title here</title> 
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> 
 </head> //ww  w  .  j  ava 2s.  c  o m
 <body> 
  <h1 class="example">this is going to be the title</h1> 
  <script>
 var my = $(".example").html();
 $('title').html(my);
 
      </script>  
 </body>
</html>

Related Tutorials