To highlight the anchor use following css style code:
<style type="text/css" >
a{color:orange;text-decoration:none;font:bold}
a:focus{color:cyan}
</style>
<script>
function FocusOnInput(){
<script>
function FocusOnInput(){
document.getElementById('text').focus();
}
//Add FocusOnInput() in onload event in the body attribute:
//Add FocusOnInput() in onload event in the body attribute:
</script>
< body onload="FocusOnInput()" >
use id="text" # highlighthe first componenet
Eg:
<a id="text" href="http://google.com"> </a>
Note: DOM Level 2 HTML
only elements that have a
HTMLInputElement,
HTMLSelectElement,
HTMLTextAreaElement and
HTMLAnchorElement. eg: <a id='text' hreaf= ... >
And this notably omits HTMLButtonElement and HTMLAreaElement.
Logging on condition:
function logt(msg)
{
if(navigator.appName == "Netscape") {
console.log("[DBG]: " + msg);
} else {
alert(msg); }
}
Note: DOM Level 2 HTML
only elements that have a
focus()
method are HTMLInputElement,
HTMLSelectElement,
HTMLTextAreaElement and
HTMLAnchorElement. eg: <a id='text' hreaf= ... >
And this notably omits HTMLButtonElement and HTMLAreaElement.
Logging on condition:
function logt(msg)
{
if(navigator.appName == "Netscape") {
console.log("[DBG]: " + msg);
} else {
alert(msg); }
}
No comments:
Post a Comment