I am trying to get id of clicked button and with that case I want to change change/add class of specifiv div.
Here is the code:
$("input").click(function (e) {
var idClicked = e.target.id;
switch (idClicked) {
case 'regiesterButton':
$('regiesterAlert').css('class', 'alert alert-danger');
$('regiesterAlert').append('<b>Error</b> Blabla')
break;
case 'loginButton':
break;
case 'loginButton':
break;
}
});
EDIT: After it steps into case there is exception:
if(!jQuery)throw new Error("Bootstrap requires jQuery");+function(a).....
What`s wrong in the code?