On Aug 28, 12:51 am, MrNase <[EMAIL PROTECTED]> wrote:
> What I was trying to do here was to make a mootools example in jQuery.
>
> In mootools, all you need is:
>
> if(txt.val().contains('hello')) txt.trigger('burn', 'hello world!');
It would seem that val() returns a String object and that moot
On Aug 27, 3:20 pm, MrNase <[EMAIL PROTECTED]> wrote:
> if ($('#myTextarea').val().indexOf('hello') != -1) {
> log.empty().html('test');
> }
> else if
> ($('#myTextarea
What I was trying to do here was to make a mootools example in jQuery.
In mootools, all you need is:
if(txt.val().contains('hello')) txt.trigger('burn', 'hello world!');
Therefore I was looking for a jQuery way to do it but contains()
doesn't work as expected. :(
On Aug 27, 3:39 pm, Klaus
MrNase wrote:
$('#myTextarea').attr('val').indexOf('hello') != -1
--Klaus
$('#myTextarea').val().indexOf('hello') != -1
works. Thanks! :)
Now, when I extend my code it doesn't work anymore.
if ($('#myTextarea').val().indexOf('hello') != -1) {
> $('#myTextarea').attr('val').indexOf('hello') != -1
>
> --Klaus
$('#myTextarea').val().indexOf('hello') != -1
works. Thanks! :)
Now, when I extend my code it doesn't work anymore.
if ($('#myTextarea').val().indexOf('hello') != -1) {
> I already tried several versions including this one:
>
> $('#myTextarea').bind("keyup", function(){
> if ( $("#myTextarea[value:contains('hello')]"))
> log.empty().html('test');
>
> });
I think skipping the attribute part of the jquery string should work:
if ( $("#myTextarea:con
MrNase wrote:
I am currently at war with the contains function. :-(
Here's my snippet which doesn't work.
$('#myTextarea').bind("keyup", function(){
if
($('#myTextarea').attr('val').contains('hello')) {
7 matches
Mail list logo