/    Sign up×
Community /Pin to ProfileBookmark

Hi,
How can i programmatically realize that a word wraped on a html textbox.
Thanks

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@JPnycFeb 21.2005 — Excuse me?
Copy linkTweet thisAlerts:
@UltimaterFeb 22.2005 — with myobject.style.wordWrap

for example:

<textarea ID="myobject" style="wordWrap: normal;">

...

</textarea>

<script>

var timerID=null

function ONLD(){

clearTimeout(timerID)

if(typeof blah=="undefined")timerID=setTimeout("ONLD()",1)

LD()

}

ONLD()

function LD(){

alert(myobject.style.wordWrap)

}

</script>


wordWrap can have a string-value of either

"normal" or "break-word"

this value can also be assigned via javascript:

document.getElementById("myobject").style.wordWrap="break-word"
×

Success!

Help @chadorbaf spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...