HTML and CSS Reference
In-Depth Information
A typical use case would be the display of the result of a calculation generated by a
script. The following script would update the value of the output element every time
the two number inputs are changed:
var inputa;
var inputb;
var resultfld;
function init(){
inputa = document.getElementById("inputa");
inputb = document.getElementById("inputb");
resultfld = document.getElementById("resultfld");
inputa.oninput = updateResult;
inputb.oninput = updateResult;
}
function updateResult(){
resultfld.value
=
Num-
ber(inputa.value)+Number(inputb.value);
}
window.onload = init;
Cryptographic key generator
The keygen element is used to generate a private and public cryptographic key, the
public side of which is sent to the server at form submittal. The element itself is rather
cryptic-looking because it is by default a drop-down list of numbers and nothing more.
These numbers are the bit size of the keys used in the encryption algorithm. Larger num-
bers will result in more difficult-to-crack keys. The expected use case for this element
would be that the server would generate a certificate that is sent back to the client to
establish a trusted secure communication between the two. Cryptography for encrypted
communication between a web page and web server is beyond the scope of this topic,
and this element is not one you are going to use unless you know something about cryp-
tography already. 7 Even if you do know something about cryptography, don't necessar-
ily get too attached to this element in its current form. There is the distinct possibility
that it will change course in the future (the HTML specification is still in draft status
after all). For instance, representatives from Microsoft have stated they have no inten-
tion of supporting keygen ( keygen was original developed by Internet Explorer com-
petitor Netscape, so Microsoft approached implementing cryptography from a different
direction). The current approach toward the element's standardization makes the actu-
Search WWH ::




Custom Search