0

I would like to be able to change the "wrap" attribute for a textarea with javascript. That is unless you can provide a cross browser solution in css2, giving me the ability to just modify the css attributes.

Thank you in advance.

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by OS_dev
0

never mind, I got it. Here is my solution using jquery:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.wordWrap.js"></script>
<script type="text/javascript" language="javascript">
function toggleWrap(checkbox, elementID)
{
    if(checkbox.checked == true)
    {
        $("#" + elementID).wordWrap("on");
    }
    else
    {
        $("#" + elementID).wordWrap("off");
    }
}
</script>

Edited by OS_dev: n/a

0

I would like to be able to change the "wrap" attribute for a textarea with javascript. That is unless you can provide a cross browser solution in css2, giving me the ability to just modify the css attributes.

Thank you in advance.

set the attribute

wrap="hard"

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.