views:

181

answers:

2

I'm trying to get the html inside several elements like this:

<div class="option s12 pointer"><img class="fl mt2" src="http://web.iboomerang.com/icons/fff/magnifier.png" /> Trainings by date</div>

Is there a way to strip the tag (like PHP's strip_tags does) and leave only "Trainings by date".

Note: I need to avoid using functions like split() or replace(), because of how versatile this app needs to be.

+1  A: 

I think you want this: http://docs.jquery.com/Attributes/text

dhulk
Wow. I've been using jQuery for how long now and I haven't even touched that function?! Well atleast I know what it does now.Approved answered, grade A bacon for you!
jhat
+1  A: 

You can use jQuery's text() function:

var text = $('div.option').text();

You can easily replace 'div.option' with whatever CSS selector(s) you need.

Jordan Ryan Moore