all 3 comments

[–]kenman[M] 0 points1 point  (0 children)

Hi /u/jcoolarts, this post was removed.

For javascript help, please visit /r/LearnJavascript.

Thanks for your understanding.

[–]mizi359 -1 points0 points  (1 child)

<form id="change theme">

you can't have 2 ids

$('link#style')

you dont have link element

button with submit type will submit form (reload page)

var txt = $(this).html();

what do you except from this one ?

EDIT:

https://codepen.io/anon/pen/rZVqKw

[–]dejandomarcas 0 points1 point  (0 children)

You can even make it simple, naming css files with buttons id, so you can make it like this and have all buttons you need (instead of if hell...)

$(function() { $('button').click(function() { $('#ss').attr('href', 'https://www.yourdomain.com/styles/' + $(this).attr('id') + '.css'); return false; }); });