User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 374,170 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,417 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 663 | Replies: 3
Reply
Join Date: Feb 2007
Posts: 10
Reputation: dks1383 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
dks1383 dks1383 is offline Offline
Newbie Poster

Help how to change the aligment of a textarea

  #1  
Dec 31st, 2007
Hi all

How can I write a javascript code to change the alignment of a textarea so that the user can select a part of of a textarea and change the alignment of this part by clicking a button?
thanks
Last edited by dks1383 : Dec 31st, 2007 at 3:09 am.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2007
Posts: 2,433
Reputation: MidiMagic is on a distinguished road 
Rep Power: 6
Solved Threads: 99
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Posting Maven

Re: how to change the aligment of a textarea

  #2  
Jan 1st, 2008
Try the textAlign style.

But it may not work. The text alignment of a text box or a text area depends on the data type it is used for.
Daylight-saving time uses more gasoline
Reply With Quote  
Join Date: Dec 2007
Location: www.JavaScriptBank.com
Posts: 5
Reputation: temp304 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
temp304's Avatar
temp304 temp304 is offline Offline
Newbie Poster

Re: how to change the aligment of a textarea

  #3  
Jan 3rd, 2008
text-align Attribute | textAlign Property

Sets or retrieves whether the text in the object is left-aligned, right-aligned, centered, or justified


The property is read/write for all objects except the following, for which it is read-only: currentStyle . The property has a default value of left . The Cascading Style Sheets (CSS) attribute is inherited.

Applies To: BLOCKQUOTE , BODY , CENTER , currentStyle , DD , DIR , DIV , DL , DT , FIELDSET , FORM , hn , HR , INPUT type=password , INPUT type=text , LI , LISTING , MARQUEE , MENU , OL , P , PLAINTEXT , PRE , runtimeStyle , style , TABLE , TD , TEXTAREA , TH , TR , UL , XMP
www.JavaScriptBank.com - 2.000+ free JavaScripts
Start hosting from: $22/year | With promo code: 97USDD | At DreamHost
Reply With Quote  
Join Date: Apr 2007
Location: Birmingham
Posts: 368
Reputation: Fungus1487 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 35
Fungus1487's Avatar
Fungus1487 Fungus1487 is offline Offline
Posting Whiz

Re: how to change the aligment of a textarea

  #4  
Jan 3rd, 2008
but you still wont be able to align PART of the text differently to another part. Not in the same textbox anyway.
When Autumn Falls [ http://www.whenautumnfalls.co.uk ] &&
Designdotworks [ http://www.designdotworks.co.uk ] Web / Graphic / Software Design
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 4:21 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC