mam problem bowiem chciałbym aby za pomocą JS w html'u było:
a potem
jednak nie wiem jak coś takiego zrobić, największy problem sprawia mi tutaj żeby użyć w tagu HTML'a JS'u. Tj. nie wiem jak w rows="zmienna w JS" umieścić tą zmienną JS.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript"> function add_row(id) { $("#"+id).animate({"rows": "+=1"}); } </script> </head> <body> </body> </html>
function zmienIloscWierszy( ilosc ) { var textArea = document.getElementById( 'IdTextArea' ); var rows textArea.getAttribute( 'rows' ); textArrea.setAttribute( 'rows', Number( rows ) + Number( ilosc ) ); };