I would like to dynamically remove or disable a <style>
tag
that looks like this
<style type="text/css" id="cssx/portal/simple-sidebar.css" designtr="cssx/portal/simple-sidebar.css">
#wrapper {
padding-left: 0;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#wrapper.toggled {
padding-left: 250px;
}
#sidebar-wrapper {
z-index: 1000;
position: fixed;
left: 250px;
width: 0;
height: 100%;
margin-left: -250px;
overflow-y: auto;
background: #000;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
</style>
if I have the id or my own defined designtr property, I can't seem to disable or remove it like so:
var id = 'x';
var designtr = 'x';
document.getElementById(id).disabled = true; //doesn't work, throws an error saying element is null
$('style[designtr="' + designtr + '"]').remove(); //doesn't work, although strangely no error thrown
I read somewhere that even with HTML5 style tags can't have a valid id attribute.
All I want to do is either remove or disable a style tag, given some unique id that I have in hand.
Works like a charm:
document.getElementById('remove').onclick = function () {
document.getElementById('styl').remove();
};
<div>Some Div Content</div>
<button id="remove">remove</button>
<style id="styl">div{background-color: red}</style>
I really need help. I am a newbie programmer and really not sure how can i do this in joomla. I need to create a pop up or iframe that pass variable from the parent page. Basically what is to happen ...
I really need help. I am a newbie programmer and really not sure how can i do this in joomla. I need to create a pop up or iframe that pass variable from the parent page. Basically what is to happen ...
I'm trying to create a client-side only application using Firebase as a database service and I'm experiencing some difficulties defining a security rules that will allow multiple 'admin' users access ...
I'm trying to create a client-side only application using Firebase as a database service and I'm experiencing some difficulties defining a security rules that will allow multiple 'admin' users access ...
While using Bootstrap 2.3, Bootbox and viewing the result in Google Chrome on Ubuntu you get a less than appealing border around the button because it is auto-focused. I havent found any api hooks to ...
While using Bootstrap 2.3, Bootbox and viewing the result in Google Chrome on Ubuntu you get a less than appealing border around the button because it is auto-focused. I havent found any api hooks to ...
I have about 30-40 images that I'm currently attempting to reload. However, I still get this "flicker" when I hover over a image. The images disappear for a couple of milliseconds and then comes back. ...
I have about 30-40 images that I'm currently attempting to reload. However, I still get this "flicker" when I hover over a image. The images disappear for a couple of milliseconds and then comes back. ...