nshah
nshah

Reputation: 597

Get the value of toggle switch jQuery Mobile

When the submit is pressed I want to alert the value of the switch, however it is not working as planned

jsFiddle

http://jsfiddle.net/Q3p9X/

JS

$('#newevent1info').submit(function (event) {
    var val = $('#newevent1').slider().value;
    alert(val);
}

ALSO for some reason its creating a slider in my header:

enter image description here

Upvotes: 0

Views: 1514

Answers (1)

vladkras
vladkras

Reputation: 17227

you should use val() not value

check this example

Upvotes: 1

Related Questions