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.
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"
set the attribute
wrap="hard"
actually, since "wrap" is not really a valid attribute in a textarea, changing it in javascript is not cross browser compatible.
http://www.w3.org/TR/html4/interact/forms.html#edef-TEXTAREA
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.