javascript - How to test if an input contains a question mark? -
I have a script which tests, if there is an input question mark, and if this happens then some CSS changes is. How can I do this?
Do not use jQuery: Update: Confirm KidDown () jQuery usage : <("" " "=") = $ 1) {$ ("# someotherelement") CSS ("color", "red"); $ (This). CSS ("color", "green"); } And {warnings ("question mark is not included"); }
if (document.getElementById ('myinputbox'). Value.indexOf ("?") = 1) { Document.getElementById ("Some LayerHelments") ClassName + = "NewClass"; This.className + = "NewClass"; } And {warnings ("question mark is not included"); }
$ ("# myinputbox"). Keydown (function () (if ($ (This) .val () IndexOf ("?") = -1) {$ (this). CSS ("color", "green");} and {$ (this ) .css ("color", "red");}});
Comments
Post a Comment