Created
September 20, 2018 08:03
-
-
Save almond-bongbong/dfe78fdb5d81041d966ea9fbc4874942 to your computer and use it in GitHub Desktop.
good case , ie9 <=
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// <input type="text" id="email"> | |
// <input type="text" id="name"> | |
// <input type="text" id="phone"> | |
// <div id="notice"></div> | |
function show(text) { | |
document.getElementById('notice').innerHTML = text; | |
} | |
function set() { | |
var a = [ | |
{id: 'email', text: 'email'}, | |
{id: 'name', text: 'name'}, | |
{id: 'phone', text: 'phone'}, | |
]; | |
a.forEach(function(item) { | |
document.getElementById(item.id).onfocus = function() { | |
show(item.text); | |
} | |
}); | |
} | |
set(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment