HTML:
<textarea cols="50" rows="5" id="txtHtmlContent">
</textarea>
jQuery:
if ( $("#rdbHtmlContent").attr("checked") ) {
alert( $('#txtHtmlContent').val() );
}
But alert show empty. What is my mistake?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The code seems to be working as expected. I setup a test case on jsbin and confirmed that it’s working:
HTML
JS/jQuery
Demo online: http://jsbin.com/iritid/2/edit