By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,044 Members | 1,234 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,044 IT Pros & Developers. It's quick & easy.

find the length of string inside the div tag in javascript

P: 1
see I have done this:
I want to find the length of the string which is inside the div tag .
Expand|Select|Wrap|Line Numbers
  1.         <script>
  2.             function show_hide()
  3.             {
  4.             var l = getElementById("text").length;
  6.                 alert(l);
  8.             }
  9.         </script>
  10.        <div id="text"><p>I am the text which you want my length</p></div>
Jan 11 '17 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 5K+
P: 8,639
have a look at the error console (F12). It will list your issues.
Jan 12 '17 #2

Post your reply

Sign in to post your reply or Sign up for a free account.