onBlur: When the input box loses focus;
onFocus: After obtaining the focus input box;
1, directly in the attribute of the element;
<input type="text" id="test" οnblur=" test() " >
2, binding events with js
<Script>
var Test1 = document.getElementById ( 'Test');
Test1 .onblur = function () {// function executed};
</ Script>