Im using javascript to change the display of a object, there is a css class already for the same object : #id{display:none;} When i use javascript to alter display to display:block, the Display:block; appears on the object itself in the HTML. The css propertys seem to be overriding the html's propertys because it still doesnt display.
prev4.onclick = function(){
lrg.setAttribute("src", eventpic4);
lefta.setAttribute("display", "block");
};
-
1post some codes what you've triedpolin– polin2012-11-06 07:45:43 +00:00Commented Nov 6, 2012 at 7:45
-
1HTML inline styles will always take precedence over CSS styles. I recommend opening it up in Chrome's Web Developer and see what the computed styles are for the element.Alan– Alan2012-11-06 07:47:33 +00:00Commented Nov 6, 2012 at 7:47
-
1@Alan unless the css style has !important. Also, there are some quirks between using actual css and html style attributes(like with and border attributes)René– René2012-11-06 07:56:12 +00:00Commented Nov 6, 2012 at 7:56
Add a comment
|