[jQuery] Re: How to make the first word bold.

2007-11-13 Thread Viktor Tarm
> > > 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

[jQuery] Re: How to make the first word bold.

2007-11-13 Thread Viktor Tarm
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

[jQuery] Re: How to make the first word bold.

2007-11-13 Thread Matt W.
) ); > }); > > 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

[jQuery] Re: How to make the first word bold.

2007-11-13 Thread [EMAIL PROTECTED]
try $(document).ready(function() { $('#links a').each(function(){ var mystring = $('this').html(); var firstword = mystring.replace(/(^\w+)/,' $1'); $(this).htm

[jQuery] Re: How to make the first word bold.

2007-11-12 Thread Jeffrey Kretz
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'

[jQuery] Re: How to make the first word bold.

2007-11-12 Thread Wizzud
> 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

[jQuery] Re: How to make the first word bold.

2007-11-12 Thread Andy Matthews
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

[jQuery] Re: How to make the first word bold.

2007-11-12 Thread Viktor Tarm
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

[jQuery] Re: How to make the first word bold.

2007-11-12 Thread Karl Swedberg
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

[jQuery] Re: How to make the first word bold.

2007-11-12 Thread Andy Matthews
).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

[jQuery] Re: How to make the first word bold.

2007-11-12 Thread [EMAIL PROTECTED]
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);