Reputation: 47
<textarea name="comt_graph" id="coment_group_value"
rows="5" style="width:275px; border:1px solid #D6403F;"></textarea>
and jquery code is
$(document).ready(function (){
$('.group_coment').live('click',function (){
var coment_val = $('#coment_group_value').val();
alert(coment_val);
return false;
});
});
Upvotes: 1
Views: 87
Reputation: 4456
Hi i check it in js fiddle but it work fine for me
Are you use the developing tools for this ? your code is working...
Error script in another place can make you code stopped working. Try to check your syntax
Upvotes: 2
Reputation: 1543
There is no group_coment class in your HTML. Either provide a class in HTMl or write this code for check the value of the textarea.
`$(document).ready(function (){
var coment_val = $('#coment_group_value').val();
alert(coment_val);
});`
Upvotes: 0
Reputation: 6169
From the code you've provided, there is no group_coment
class in your HTML.
Either:
class="group_coment"
to your textarea
element, or.group_coment
with #coment_group_value
Or, if this is the only textarea
element on the page, you could replace .group_coment
with textarea
.
Upvotes: 1