jquery - on click of button color is not changed -


I have the html code I click on the button color onclick. I $ ("# submitButton"). I use CSS ("background-color", "yellow"); but it does not change on click.

Here is my HTML code

   & Lt; Link rel = "stylesheet" href = "docs / assets / css / jqm-docs.css" /> & Lt; Link rel = "stylesheet" href = "docsdemos-style-override.css" /> & Lt; Script type = "text / javascript" charset = "utf-8" src = "cordova -1.9.0. Js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "jquery.mobile/jquery-1.7.2.min" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" charset = "utf-8" src = "js / main.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; $ (Document) .bind ("mobileinit", function () {console.log ("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $ "); $ .mobile.pushStateEnabled = false; $ .mobile.defaultTransition = 'slideup';}); & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "jquery.mobile/jquery.mobile-1.1.0.js" & gt; & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Div data-role = "page" & gt; & Lt; Div data-role = "header" & gt; & Lt; H1 & gt; Form page & lt; / H1> & Lt; / Div & gt; & Lt ;! - / header - & gt; & Lt; Div data-role = "content" & gt; & Lt; Form id = "loginForm" & gt; & Lt ;! - Wrap the input in the area, which will solve the boundaries and padding, break the layout - & gt; & Lt; Div data-role = "field content" & gt; & Lt; Label = "firstname" & gt; Username: & lt; / Labels & gt; & Lt; Input type = "text" name = "user name" value = "" id = "user name" /> & Lt ;! - Usage id and name value - & gt; & Lt; / Div & gt; & Lt; Div data-role = "field content" & gt; & Lt; Label = "password" & gt; Password: & lt; / Labels & gt; & Lt; Input type = "password" name = "password" value = "" id = "password" /> & Lt ;! - Usage id and name value - & gt; & Lt; / Div & gt; & Lt; Div data-role = "field content" & gt; & Lt; Label = "dob" & gt; Date of Birth: & lt; / Labels & gt; & Lt; Input type = "password" name = "dob" value = "" id = "dob" /> & Lt ;! - Usage id and name value - & gt; & Lt; / Div & gt; & Lt; Div data-role = "button" & gt; & Lt; Input type = "submit" data-roll = "button" value = "login" id = "submit button" & gt; & Lt; / Div & gt; & Lt; / Form & gt; & Lt; / Div & gt; & Lt; Div data-role = "footer" & gt; & Lt; H4 & gt; Foot material & lt; / H4 & gt; & Lt; / Div & gt; & Lt ;! - / footer - & gt; & Lt; / Div & gt; & Lt; Script type = "text / javascript" & gt; $ (Function () {$ ('# submitButton'). ('Click', function (e) {e.preventDefault (); $ (this). CSS ("background-color", "yellow"); hologin ( );});}); & Lt; / Script & gt; & Lt; / Body & gt; & Lt; / Html & gt; Click the Submit button, it calls the handlogin () function but the color does not change. Any help would be appreciated.   

What jQuery has been included properly? Because it works in my JSField.

Perhaps the page is refreshed when the request is submitted?

Comments