jQuery: split and hide html data
I need to split somehow some html data (a text wi开发者_运维知识库th html tags) into two parts and hide the second one with a show/hide link.
The thing is all texts are being stored in the database with html tags. Some of those texts are short, but some are really long. We don't want't to show long ones, so one of the options is to show a teaser with a show/hide link. I can't just cut the string though (let's say first 300 characters), because it'll break html code of the page.
I'm looking for a solution/suggestions how to show a teaser of the text using jQuery without breaking the html code of the page.
Thank you.
have you looked at expader ? looks like that is what your looking for
精彩评论