javascript - getElementById alternative $('test1') not working -
i have html forum submitting javascript:
<form name="test"> username: <input type="text" id="user"><p id="user1"></p> password: <input type="password" id="pass"> <p id="password1"></p> <button type="submit" onclick="return testchecker()" >submit</button> </form>
while within testchecker
function have:
$('user1').innerhtml = 'enter username'; //document.getelementbyid('user1').innerhtml = 'enter username';
the problem when utilize getelementbyid
works fine , displayed. when utilize $('user1')
doesn't anything.
any idea?
this right syntax:
$('#user1').html("enter username");
jsfiddle
javascript jquery html getelementbyid
No comments:
Post a Comment