Skip to main content

Bug Tracker

Side navigation

Ticket #6193: textarea-jquery.html

File textarea-jquery.html, 1.1 KB (added by capape, March 01, 2010 03:44PM UTC)

Load the file and press button. The data in textarea is read with diferent methods, and shown with alerts.

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Insert title here</title>
<script type="text/javascript"
<form  id="form-textarea" method="post" action="">
<textarea id="area" name="area" rows="3" cols="80">linea 1
linea 2</textarea>
<input type="button" onclick="enviar()" value="Enviar" />
<script type="text/javascript">
    function enviar() {
       // document.getElementById("area").value="hola\r\nadios" ;
        alert("escape(document.getElementById('area').value): "
                + escape(document.getElementById('area').value));
        alert('escape($("#area")[0].value): ' + escape($("#area")[0].value));
        alert('escape($("#area").val()): ' + escape($("#area").val()));

Download in other formats:

Original Format