remove only first <br> of a div by jquery -


i'm trying jquery delete first <br> of specific div.

i'm using following jquery:

if($(window).width() < 750 ){     $('[data-url-id=section4]:lt(2) br').remove(); } 

which delete br instaed of first 1 div

if replace lt(2) lt(1) or other, does't work.

<h2 style="text-align:center;" id="yui_3_17_2_1_1452876314695_505"> , we’re beginning see<br> tip of looks like: <br><br>  it’s sharing economy, internet of things,  <br>  quantified self,  possibilities of virtual reality&nbsp;and robotics. it’s shaping ideas global   leadership.and underneath of this, there’s more fundamental shift taking place, rise    in new way of doing things.</h2> 

this you're looking for

https://api.jquery.com/first/

$('[data-url-id=section4] br').first().remove(); 

Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -