Internet Explorer allows you to accidentally call elements in your html with crossed identification properties. For instance, if you wanted to call the menu of your html area, 'menu' and then reference it in Javascript, IE would allow this:
<div name="menu">testing</div>
<div name="debug">debug area</div>
<script type="text/javascript" language="javascript">
var menu=document.getElementById('menu');
var debug=document.getElementById('debug');
debug.innerHTML=menu.innerHTML;
</script>
Firefox and other browsers would not spit out 'testing' into the debug div when run. When you getElementById, yo uneed to define the element's actual 'id' not 'name' which in your mind can bridge as the same thing, a semantic, but it is not. Here is the correct way to name your elements for a JS reference:
<div id="menu">testing</div>
<div id="debug">debug area</div>
<script type="text/javascript" language="javascript">
var menu=document.getElementById('menu');
var debug=document.getElementById('debug');
debug.innerHTML=menu.innerHTML;
</script>
this will produce 'testing' in the debug area in both IE and FF, and all compliant browsers.
Properly adding 'name' and 'id' to an element
notes and quirk solutions found over time
-
- Site Admin
- Posts: 253
- Joined: Tue Oct 27, 2009 9:33 pm
Jump to
- Software and hardware tips
- ↳ 3D
- ↳ actionscript2 as2
- ↳ Actionscript 3 as3
- ↳ after effects
- ↳ android
- ↳ Apple osX support
- ↳ CPP C++ Setup, Programming, and Quirks
- ↳ CSS
- ↳ digital phone systems
- ↳ drupal
- ↳ Fallout 4 Mods
- ↳ game tips and tech
- ↳ HDV video
- ↳ HTML5
- ↳ Infected Software
- ↳ javascript
- ↳ Java programming
- ↳ laptop repair
- ↳ MySQL
- ↳ osx86 fun
- ↳ php scripting and programming
- ↳ Regular Expressions In Varying Programs
- ↳ ruby | ruby on rails | win7
- ↳ Shared Server Help
- ↳ Virus removal
- ↳ Virtual Machines
- ↳ Virtual Reality VR
- ↳ vista support
- ↳ Visual Studio 2015
- ↳ vpn
- ↳ web plugins addons
- ↳ win xp
- ↳ windows 7 support
- ↳ windows 8 support
- ↳ windows 10 support
- ↳ wordpress
- ↳ XBOX One X
- ↳ Windows 11 support
- online website reviews
- ↳ not refurbished but broken products
- internet crime evidence
- ↳ phony websites with fake credentials selling items
- writing
- ↳ science fiction
- Debunking Myths
- Film TV and Media Reviews
- ↳ Film Reviews