jQuery Add Title to Div

Glenn Glenn's Blog 0 Comments

A very quick one for you on how to add a ‘Title’ attribute to a div/element. Unsuprisingly we are using the jQuery ‘attr’ function:-

<!-- Add Title to Element -->
<script type="text/javascript">  
   $(document).ready(function() {  
$('#your-div').attr('title', 'Your title goes here');
});  
</script>
About the Author
jQuery Add Title to Div jQuery Add Title to Div 0da77002febbfe28d15144a57bbcc2c9 s 180 d mm r g

Glenn

A highly experienced Web Developer (WordPress, Webflow, Weebly & Custom), Front-end / Back-end Developer & New Media Specialist, with extensive knowledge of a wide spectrum of technologies in the Development and Creative Industries, built up over a number of years.