Change Style with onclick
Posted: Fri Feb 26, 2010 2:37 pm
I am trying to add a style to the page with onclick as shown below.
I can't seem to get it to work. I'm not sure if I'm escaping my quotes for <style type=\'text/css\'> or what.
Is what I'm trying to do even possible? When that line of code is added to the page would the new style be recognized?
Code: Select all
<a href="#" onclick="document.getElementById('customcontainer').innerHTML='<style type=\'text/css\'> .corporate {filter:alpha(opacity=10); opacity: 0.3;} </style>';return false;">
Change style!
</a>Is what I'm trying to do even possible? When that line of code is added to the page would the new style be recognized?