Can't change textarea to input, otherwise the virtual keyboard is not working

Hi guys, i’ve been trying to customizing this virtual keyboard but have no clue what is wrong.

If i change
<textarea id=“write” type=“password” rows=“1” cols=“30”></textarea>
to
<input id=“write” type=“password”/> the virtual keyboard isn’t working.

Could anyone please help me how to solve this? Thanks in advanced.

Please check this out
http://jsfiddle.net/rhXx8/2/

Hi there,

This is the line responsible for updating the output:

$write.html($write.html() + character);

When $write references a <textarea> element, everything works as expected, however when you change the <textarea> element to in <input> element, the script fails, as an <input> element doesn’t have a .html() method.

Change the above line to this and things will work as expected:

$write.val($write.val() + character);

Hope that helps.

Hi Pullo, thanks for your help. It works.

As you said that “an <input> element doesn’t have a .html() method”, do you know where can i find the best reference of this?
Thanks again :slight_smile:

Hi there,

A good place to look is the jQuery API documentation.

In this particular case, looking at the docs for [.html()](http://api.jquery.com/html/) might be a good place to start.

ok thanks, might need a longer time to get the whole picture… :slight_smile: