i have two buttons. now i want the vistor to click the button2, the site invoks the style2.css,when click button1. invoks the style.css. the default shows the style.css is there a ways to use jquery change the the link path of css.
<link rel="stylesheet" href="http://www.example.com/themes/style.css" type="text/css"/>
if click button2, change the line to <link rel="stylesheet" href="http://www.example.com/themes/style2.css" type="text/css"/>
or other ways to get the effect. thank you
In button2’s onclick handler, do this:
EDIT: Apparently I need to point out that this will affect all link tags if you have more than one, so use an id as your selector if you have more than one link, e.g.: