469,920 Members | 2,225 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,920 developers. It's quick & easy.

onblur event not working for span element

34
I have an element that is a span. The span is filled in with data using innerHTML.

Expand|Select|Wrap|Line Numbers
  1. var celldes = row.insertCell(2);
  2.     var des = document.createElement('span');
  3.     des.id='desc' + iteration; 
  4.     des.name='desc' + iteration; 
  5.     celldes.appendChild(des);
  6.     des.innerHTML = " ";
  7.  
  8. des.onchange = function(){ SOME CODE }; //WORKS
  9. des.onblur = function(){ SOME CODE }; //NO RESPONSE
  10.  
the onchange event works, but the onblur event has no response
Dec 4 '07 #1
3 6997
acoder
16,027 Expert Mod 8TB
I'm not sure,but I don't think onblur is supported for the span tag. Does the span element ever receive focus?
Dec 5 '07 #2
gsherp
34
The onblur only works if inside the span element there is an input field.
then the onblur is connected to the blurring action on the input field.
Dec 11 '07 #3
acoder
16,027 Expert Mod 8TB
The onblur only works if inside the span element there is an input field.
then the onblur is connected to the blurring action on the input field.
That confirms what I thought.
Dec 12 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by andyalean | last post: by
17 posts views Thread by steve | last post: by
2 posts views Thread by Heiko Vainsalu | last post: by
5 posts views Thread by moondaddy | last post: by
1 post views Thread by neil S via DotNetMonster.com | last post: by
9 posts views Thread by aashishn86 | last post: by
reply views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.