I tried this code, but when I enter text into textarea the alert() isn't works. How to fix it?
<textarea name="textarea" placeholder="Enter the text..."></textarea>
$(document).ready(function () {
if ($("textarea").value !== "") {
alert($("textarea").value);
}
});
document.getElementById("textareaID").value
$("#textareaID").val()
Cannot do the other way round (it's always good to know what you're doing)
document.getElementById("textareaID").value() // --> TypeError: Property 'value' of object #<HTMLTextAreaElement> is not a function
jQuery:
$("#textareaID").value // --> undefined