dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Count the number of character before <ul> tag

  1. #1
    Join Date
    Sep 2012
    Posts
    1

    Count the number of character before <ul> tag

    I want to count a number of character before the <ul> tag
    like example.
    <p class="para1">
    Here are the list of things i like
    <ul>
    <li> I like school</li>
    </ul>
    </p>

    so I want to get the number of character count before a <ul> tag

  2. #2
    Join Date
    Mar 2009
    Posts
    452
    <p class="para1" id="p1">
    Here are the list of things i like
    <ul>
    <li> I like school</li>
    </ul>
    </p>
    <script>
    var p = document.getElementById('p1');
    alert(p.innerText.length);
    </script>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles