views:

59

answers:

3

i have text like this

div bla-bla end div

i need to get only 'bla-bla' without div, because of i need to call substring in controller only to text bla-bla not to div tags. is it possible

p.s. how to input tags here?

A: 
document.findElementById(..).innerText;
PieterG
no, i need call substring before view be show , formatted text stored in database
kusanagi
+1  A: 

If you have jquery you can access inner html by calling ( for example ):

$("#idofthediv").html()

to set the conntent of the div:

$("#idofthediv").html('some html')
Mike Gredziak
A: 

Take a look at using a Regular Expression.

There is a sample of what you want to do at Regular Expression Examples. It's the first sample in the section titled "Grabbing HTML Tags" near the top of the page.

griegs