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.

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>

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"

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.