Javascript examples for jQuery:Text
Get text from element
<html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> </head> <body> <span class="alerts">1</span> <script> var notifications = $('.alerts').text(); document.title = '(' + notifications + ') ' + document.title; </script> </body>//from ww w. ja v a 2s.c om </html>