How to write this code in JQuery?

0 like 0 dislike
5 views
Hi All, would look like this kad Js to Jquery?
function validateForm() { var x = document.forms["myForm"]["log"].value; var y = document.forms["myForm"]["pass"].value; if (x == " || y == ") { document.getElementById("demo").innerHTML = "Hello Dolly."; return false; } }
by | 5 views

1 Answer

0 like 0 dislike
Something like that (if absolutely literally and do not simplify):
function validateForm() { var x = $('#myForm #log').val(); var y = $('#myForm #pass').val(); if (x == "" || y == "") { $('#demo').html('Hello Dolly.'); return false; } }
by

Related questions

0 like 0 dislike
1 answer
asked May 22, 2019 by ganjo888
0 like 0 dislike
3 answers
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
33,629 users