Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

input[type="submit"] in jQuery

Tags:

jquery

css

how to do this:

input[type="submit"] {
   color:green;
}

in jQuery?

$('input[type="submit"]').css("color","green");

is not working :|

like image 939
dodancs Avatar asked Sep 30 '12 08:09

dodancs


2 Answers

Probably because it is triggering before jQuery is "ready". Try this:

$(function() {
    $('input[type="submit"]').css("color","green");
});
like image 151
Miha Rekar Avatar answered Oct 14 '22 06:10

Miha Rekar


Use a simple css instead of javascript

input[type="submit"]{
        color: green;
        cursor: pointer;
        font: bold 12px Helvetica,Arial,sans-serif;
    }
like image 41
StaticVariable Avatar answered Oct 14 '22 06:10

StaticVariable