* Sets the value of the attribute "type".
* Note: this replace the DOM node with a new one.
* @param newType the new type to set
*/
public void jsxSet_type(final String newType) {
HtmlInput input = getHtmlInputOrDie();
if (!input.getTypeAttribute().equalsIgnoreCase(newType)) {
final AttributesImpl attributes = readAttributes(input);
final int index = attributes.getIndex("type");
attributes.setValue(index, newType);
final HtmlInput newInput = (HtmlInput) InputElementFactory.instance
.createElement(input.getPage(), "input", attributes);
if (input.getParentNode() != null) {
input.getParentNode().replaceChild(newInput, input);
}