0

I have elements, generated by UI-framework as follows:

<div id="GENERATED_CONTAINER" style="position: fixed; z-index: 100; left: 368px; top: 52px; width: 545px; height: 846px;">
    <div id="GENERATED_CONTENT style="opacity: 0.1; left: 5px; top: 5px; bottom: -5px; width: 545px; height: 846px;">
    </div>
</div>

I need to write a script which is to remove width and height from style attributes.

var elems = $("[id^='GENERATED_']");
//what should I apply now?

3 Answers 3

2

Simply write .css

$("[id^='GENERATED_']").css({
  width: 'inherit', //or the value
  height: 'inherit' //or the value
})
Sign up to request clarification or add additional context in comments.

Comments

1
$("[id^='GENERATED_']").css({width:0px,height:0px})

Comments

1

You can clear the inline style using .css()

Here's a fiddle of inline style being added and removed via jQuery.css().

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.