i have html page and i want head title value on page load using jquery, see my below html code
<html>
<head>`enter code here`
<title>Home - chcc</title>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
</head>
<input type='button' value='find div .A1' id='button1'>
</body>
</html>
You don't even need jQuery for this. Just use the document.title
property
If you want jQuery instead raw javascript, use $("head title")[0];
You can select the Title tag by using only Javascript like the Following:
var title = document.getElementsByTagName("title")[0].innerHTML;
// Then you can print it on the screen
alert(title);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With