Jump to content

Remove or Edit DIV with Jquery


jarvis

Recommended Posts

HI All,

I'm hoping someone can help!

I need to either remove or change a DIV tag directly above another. Here's the code:

<div style="clear:both;"></div>
<div class="berocket_lgv_widget" style="float:left;padding: 5px 0px 5px 0px;">

Either the entire first DIV needs removing or change the style to clear:none

I thought something like:

$(".berocket_lgv_widget").prev().attr("style", " clear:none");
$(".berocket_lgv_widget").prev().remove();

No joy with either. I also tried before()

Any help is much appreciated

Thanks

Link to comment
Share on other sites

I don't think you understand me.

You can write the Javascript, yes? I sure hope so because that's a rather important aspect to the problem you're describing.
I'm not saying you don't write Javascript. I'm saying you don't write Javascript that tries to manipulate the element's style. I'm saying you do write Javascript that adds/removes CSS classes from some appropriate ancestor element, then handle the appearance changes with a CSS rule.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.