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

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

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

2007-11-13 Thread Matt W.
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. Thank you all

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

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

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

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

[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); });

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

2007-11-12 Thread Andy Matthews
) Subject: [jQuery] Re: How to make the first word bold. 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

[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+)/,'strong$1/strong'); $('#title a:first').html(firstword); --Karl _ Karl Swedberg www.englishrules.com

[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. Thank you

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

2007-11-12 Thread Wizzud
: [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 link. Karl, I made a simple page to test your code. It looks like this: script type=text/javascript src=./src/jquery-1.2.1.pack.js/ script