>
> > Viktor...
>
> > You'd probably need an $.each() on there then.
>
> > -Original Message-
> > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
>
> > Behalf Of Viktor Tarm
> > Sent: Monday, November 12, 2007 2:35 PM
7; '+t.join(' ') );
> });
>
> etc
>
> On Nov 12, 9:17 pm, "Andy Matthews" <[EMAIL PROTECTED]> wrote:
>
> > Viktor...
>
> > You'd probably need an $.each() on there then.
>
> > -Original Message-----
> > From: j
) );
> });
>
> etc
>
> On Nov 12, 9:17 pm, "Andy Matthews" <[EMAIL PROTECTED]> wrote:
>
> > Viktor...
>
> > You'd probably need an $.each() on there then.
>
> > -Original Message-
> > From: jquery-en@googlegroups.com
try
$(document).ready(function() {
$('#links a').each(function(){
var mystring = $('this').html();
var firstword = mystring.replace(/(^\w+)/,'
$1');
$(this).htm
Gotta say, that's nice and elegant.
JK
-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Wizzud
Sent: Monday, November 12, 2007 3:49 PM
To: jQuery (English)
Subject: [jQuery] Re: How to make the first word bold.
eg.
$('#links a'
> Behalf Of Viktor Tarm
> Sent: Monday, November 12, 2007 2:35 PM
> To: jQuery (English)
> Subject: [jQuery] Re: How to make the first word bold.
>
> Thank you all for your help.
>
> Andy, I'm looking to bold the first WORD, of all the links, not the first
> lin
Viktor...
You'd probably need an $.each() on there then.
-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Viktor Tarm
Sent: Monday, November 12, 2007 2:35 PM
To: jQuery (English)
Subject: [jQuery] Re: How to make the first word bold.
Than
Thank you all for your help.
Andy, I'm looking to bold the first WORD, of all the links, not the
first link.
Karl, I made a simple page to test your code. It looks like this:
$(document).ready(function() {
var mystring = $('#links a').html();
var firstw
You could also do this with a regular expression. Maybe something
like this:
var mystring = $('#title a:first').html();
var firstword = mystring.replace(/(^\w+)/,'$1');
$('#title a:first').html(firstword);
--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com
O
).wrap('');
That line says "wrap the first child in a bold tag.
-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of [EMAIL PROTECTED]
Sent: Monday, November 12, 2007 10:52 AM
To: jQuery (English)
Subject: [jQuery] Re: How to make the firs
Somebody else probably has a more consice method but you could try
something like this
var mystring = "One Two Three"; //replace with your string
var stringarray = mystring.split(" ");
var firstword = mystring.split(" ")[0];
myarray = jQuery.grep(stringarray, function(n, i){
return (i > 0);
11 matches
Mail list logo