Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Developer
devbuzz
Posts: 4
Registered: ‎02-03-2010
My Device: Curve 8900

Changing element type using Javascript

Does 4.6 Blackberry browser support changing element type using Javascript?

 

I want to implement a password toggle function so that users can click on a link and display their password in clear.

 

This is the HTML I'm using (works in FF):

 

<input id="password" name="password" type="password" value="blahblah" /><a href="" onclick="togglePasswordVisiblity();return false;">?</a>

 

and this is the javascript function.

 

<script language="javascript" type="text/javascript">
function togglePasswordVisiblity() {
var myelement = document.getElementById('password');
if (myelement.type == 'text') {
myelement.type = 'password';
}
else {
myelement.type = 'text';
}
}
</script>