<form name='theform'>
  <input type='text' name='content' value='' onblur='strlen();'>
</form>
<script>
  var a;
  function strlen(){
    return document.forms['theform'].content.value.length;
  }
  a = strlen();//a被赋值
</script>