Focus div and jump to it

by Anton Polyakin

HTML

<div id="first_text_field" >
  
  asdasdas
  <textarea name="text" id="field1" style="height: 164px;"></textarea>
  <input type="button" value="Прыгнуть!" id="b">
</div>

JavaScript

/* focus on textarea*/
window.onload = function() {
document.getElementById('first_text_field').onclick = function (event){
 if (event.target.tagName !== 'SELECT'){
    document.getElementById('field1').focus();
}  
}}
/* end of focus on textarea*/