# Other Languages > jQuery >  [RESOLVED] jquery display text

## JJJCR_FOX

hi gurus,

need your help. I had tried making this simple html with jquery.

I want to display the text on the input button to the text area simultaneously.

how do i do it? please check  code below which I had started. Thank you.



```
<!DOCTYPE html>
<html>
<head>

<style>
 <script src="http://code.jquery.com/jquery-latest.js"></script>
</style>

</head>

<body>

 <form>
  <fieldset>
    <label for="target">Type Something:</label>
    <input id="target" type="text" />
  </fieldset>
</form>

<form name="display_form">

<textarea id="txtdisp" rows="2" cols="20">

</textarea>
</form>

<script> 
 
var txt= $("#target").val();

 onKeyUp="display_form.form.txtdisp.value=txt";

</script>

</body>
</html>
```

----------


## akhileshbc

Try this:


```
<script> 
  $(document).ready(function(){
    $('#target').keyup(function(){
      var txt= $(this).val();
      $('#txtdisp').val(txt);
    });
  });
</script>
```

To test it live, check this fiddle: http://jsfiddle.net/4zrZg/

 :wave:

----------


## JJJCR_FOX

hi akhileshbc, thanks for your help.

it works on the fiddle url that you posted.

but when I tried to save the file as an html file, it doesn't work.

anything i'm missing? thank you.

----------


## akhileshbc

Are you trying to save the html file in the fiddle, just by choosing the Save As option from your browser ?

If you want to copy the code from the fiddle, just copy that code and paste it in a new html file. That's all !

 :wave:

----------


## JJJCR_FOX

hi akhileshlbc, thanks it works! 

it does not work because of the style tag:

 <style>
 <script src="http://code.jquery.com/jquery-latest.js"></script>
 </style>

but it works if i removed the <style> </style> tag.

Thanks again  :Wink:

----------


## akhileshbc

:Smilie: 

Good luck  :Thumb:

----------

