form, unrecognized expression
Hello,
I am reading certain jQuery tutorial and i don't know how should I read text area from my form. Here it is my example from tutorial(when key is up it should read how many chars are in the textarea and then pass it into <p id ='countChars'>):
-
$(document).ready(
function()
{
$("form[@name=form1] textarea[@name=content]").keyup(
function()
{
$("#countChars").html($(this).val().length);
});
});
My form:
-
<form name="form1" action="">
<textarea name="content"></textarea>
</form>
<p id="countChars"></p>
It doesn't work my bug console in a browser shows error:
JavaScript -
http://localhost/jquery/form.html
Event thread: DOMContentLoaded
Unhandled exception: "Syntax error, unrecognized expression: [@name=content]"