javascript - jQuery input value not working -
have looked solution not found one.
$(document).ready(function() { if ($("input").value()) { $("h1").hide(); } }
so not seem working ( $("h1").hide()
placeholder action... part not important, problem if statement not working).
there 1 form on page, <input type=text>
. want make @ times, if there text in input box state applied. if input box returns empty state removed.
there quite few other functions inside $(document).ready
function omitted due clarity... far scope of if statement lies directly inside of document.ready function. p.s. form shown , hidden dynamically, hard coded -- not being created dynamically.
what wrong have if statement located?
try .val()
like
$(document).ready(function(){ if ($("input").val()) { $("h1").hide(); } });
better use either name
or id
or class names
selectors.because input
can of number , includes checkboxes
,radio buttons
, button
types
Comments
Post a Comment