formatting specified string in textarea field

K

K.

I have such a text

<input type="text" name="search_txt" value="">
<textarea name="txt_m">
My hobby is bicycle.
My hobby is driving a car.
</textarea>

I would like to bold and color a specified text
in input field search_txt for instance "hobby" string.

How to do that in JS?

Thank you in advance
Marcin
 
R

RobG

K. said:
I have such a text

<input type="text" name="search_txt" value="">
<textarea name="txt_m">
My hobby is bicycle.
My hobby is driving a car.
</textarea>

I would like to bold and color a specified text
in input field search_txt for instance "hobby" string.

How to do that in JS?

You can only apply the style properties that textarea elements support.
They can be applied to the textarea as a whole (e.g. font-family or
weight), the effect may work or not depending on browser support for
the particular property.

Full details (but not browser support) are in the W3C CSS spec, their
CSS property table provides hints:

<URL: http://www.w3.org/TR/CSS21/propidx.html >

A CSS group may provide more information

news:comp.infosystems.www.authoring.stylesheets
<URL:
http://groups.google.com.au/group/comp.infosystems.www.authoring.stylesheets?lnk=li
 
K

K.

Uzytkownik "RobG said:
You can only apply the style properties that textarea elements support.
They can be applied to the textarea as a whole (e.g. font-family or
weight), the effect may work or not depending on browser support for
the particular property.

Full details (but not browser support) are in the W3C CSS spec, their
CSS property table provides hints:

<URL: http://www.w3.org/TR/CSS21/propidx.html >

A CSS group may provide more information

news:comp.infosystems.www.authoring.stylesheets
<URL:
http://groups.google.com.au/group/comp.infosystems.www.authoring.stylesheets?lnk=li


Could you be so kind and write me a small code example?

Thank you in advance
Martin.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top