lAZLf Posted May 4, 2010 Share Posted May 4, 2010 So for my website I have one style attribute for a div that changes whether or not the user is using ie or something else #dropdown { display:inline-block; margin:0px; width:110px; *display: inline; } the * means it will only work in ie. So that fine, but now i need to be able to do that, change it if its in ie, through javascript. how would i do that? something like this? document.getElementByID(id).style.XXXXXXXXXXXXXXXX? Link to comment https://forums.phpfreaks.com/topic/200695-changing-the-style-if-the-browser-is-ie/ Share on other sites More sharing options...
roopurt18 Posted May 4, 2010 Share Posted May 4, 2010 Why do you have to do this with JavaScript? Why not use the IE comment-hacks to include a small CSS file with changes for IE? Or why not define a special class in your CSS with these attributes and just add or remove the class to the div element with JavaScript? Link to comment https://forums.phpfreaks.com/topic/200695-changing-the-style-if-the-browser-is-ie/#findComment-1053225 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.