I am trying to build a simple switch in a form. It works only one way. What am I missing here that is preventing this code from working?
HTML
<div id="SlideJoinDiv" align="right" style="background-image: url(img/buttons/SchuifNederlandsBG.png">
<img width="87px" height="53px" src="img/buttons/SchuifjeKnop.png" id="SlideJoin" />
</div>
jQuery
$(document).ready(function () {
$('#SlideJoinDiv').click(function () {
var waardeStart = 'gast';
var waardeType = $('#TypeAccount').attr('value');
if (waardeType = waardeStart) {
$('#SlideJoinDiv').attr('align', 'left');
$('#TypeAccount').attr('value', 'artist');
} else {
$('#SlideJoinDiv').attr('align', 'right');
$('#TypeAccount').attr('value', 'gast');
}
});
Should be:
Right now you’re assigning, you need to be comparing.