Solved

count number of lines

Posted on 2012-03-23
5
243 Views
Last Modified: 2012-04-03
if i want to populate the number lines in a div, how do i do it using jquery and populate it in the span tag. pl advice.


<span id="count"> 10</span>
<div id="lines">
hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello world hello worldhello world hello world hello world hello world hello world hello world hello worldhello world hello world hello world hello world hello world hello world hello worldhello world hello world hello world hello world hello world hello world hello worldhello world hello world hello world hello world hello world hello world hello worldhello world hello world hello world hello world hello world hello world hello worldhello world hello world hello world hello world hello world hello world hello world
</div>
0
Comment
Question by:jcbmtt
5 Comments
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 37756054
That is only one line.  <br> or <br /> are line breaks in HTML.
0
 
LVL 40

Accepted Solution

by:
gurvinder372 earned 500 total points
ID: 37756058
You can divide the height of the div with the height of one sentence to get number of lines
0
 

Author Comment

by:jcbmtt
ID: 37756069
friends, <br>s are hidden.  what function will help me achieve this?
0
 
LVL 7

Expert Comment

by:cstsang
ID: 37765066
Is it possible to count it in server side?
0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 37775253
did you tried what i suggested?
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now