473,412 Members | 4,957 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

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 7457
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

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

Similar topics

2
by: andyalean | last post by:
Hello javascript coders :( ,I am trying to add an onblur event to my code. This is where I dynamically create a textfield.I want to assign it an onblur event handler like so.How do I add a event...
17
by: abs | last post by:
My element: <span onclick="alert('test')" id="mySpan">test</span> Let's say that I don't know what is in this span's onclick event. Is it possible to add another action to this element's onclick...
17
by: steve | last post by:
I read the book JavaScript the Definitive Guide, 3rd edition. On P217 it says I can use FOR...EVENT in <script> tag. I tried this code, it does not display the alert() window in IE 6.0. Can you...
2
by: Heiko Vainsalu | last post by:
Hi Hope somebody knows how to solve this one. *The Situation* A traditional situation where HTML form inputs are checked... (if simplified then it would look something like this) <form...
5
by: moondaddy | last post by:
I have a <a> element in a datagrid which wraps some asp.net labels. this element also has an onclick event which does not fire in netscape 6 (and perhaps other browsers for all I know...). Below...
1
by: neil S via DotNetMonster.com | last post by:
I have a custom control with a textbox and dropdown list. The dropdown list is hidden and acts as a data source for the textbox. When the user enters text in the textbox, an onKeyup event is...
4
by: bgold12 | last post by:
Hey, I have kind of a weird problem. I have a span that I'm intentionally overflowing a table cell (<td>), so that it stretches over the table cells to the right of the parent table cell. I want...
2
by: wolverine | last post by:
Hi All, In Mozilla Firefox, to onblur and onfocus event of each and every html element, the browser itself will attach a native event handler. I mean if you type,...
9
by: aashishn86 | last post by:
Hi!! i want to validate a list box onthe onblur event and if no value is selected , display a message on the left using <span> and innerHTML here's what i have written <html> <head>...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.