Coming Soon: GET:IT Endpoint Management 1-Day Conference on September 28th at 9:30 AM ET Coming Soon: GET:IT Endpoint Management 1-Day Conference on September 28th at 9:30 AM ET

js – IE11 only: Unable to get property ‘options’ of undefined or null reference

Home Forums Scripting General Scripting js – IE11 only: Unable to get property ‘options’ of undefined or null reference

Viewing 1 post (of 1 total)
  • Author
    Posts

  • alex100
    Member
    #167003

    New to this forum and hopefully someone can help. The following script works in all other browsers, except ie11, which is the one it has to work in.
    Referencing this line:
    var lable=event.target.options[event.target.selectedIndex].parentNode.label;[/CODE]
    vanilla js only, no jquery. Here is sample html and javascript. If anyone can help so it works in ie11, would appreciate [CODE]
    function run(event) { console.log(document.getElementById(“user”).label); var lable=event.target.options[event.target.selectedIndex].parentNode.label; if(lable == ‘user’){ document.getElementById(“copy”).value = “user”; } else if (lable == ‘warehouse’) { document.getElementById(“copy”).value = “warehouse”; } else if (lable == ‘dollhouse’) { document.getElementById(“copy”).value = “dollhouse”; } } [/CODE]

    [HTML]

    [/HTML][CODE] var lable=event.target.options[event.target.selectedIndex].parentNode.label;[/CODE]
    vanilla js only, no jquery. Here is sample html and javascript. If anyone can help so it works in ie11, would appreciate
    function run(event) { console.log(document.getElementById(“user”).label); var lable=event.target.options[event.target.selectedIndex].parentNode.label; if(lable == ‘user’){ document.getElementById(“copy”).value = “user”; } else if (lable == ‘warehouse’) { document.getElementById(“copy”).value = “warehouse”; } else if (lable == ‘dollhouse’) { document.getElementById(“copy”).value = “dollhouse”; } } [/CODE]

    [HTML]

    [/HTML][CODE]
    function run(event) { console.log(document.getElementById(“user”).label); var lable=event.target.options[event.target.selectedIndex].parentNode.label; if(lable == ‘user’){ document.getElementById(“copy”).value = “user”; } else if (lable == ‘warehouse’) { document.getElementById(“copy”).value = “warehouse”; } else if (lable == ‘dollhouse’) { document.getElementById(“copy”).value = “dollhouse”; } } [/CODE]

    [HTML]

    [/HTML]

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

Live Webinar: Active Directory Security: What Needs Immediate Priority!Live on Tuesday, October 12th at 1 PM ET

Attacks on Active Directory are at an all-time high. Companies that are not taking heed are being punished, both monetarily and with loss of production.

In this webinar, you will learn:

  • How to prioritize vulnerability management
  • What attackers are leveraging to breach organizations
  • Where Active Directory security needs immediate attention
  • Overall strategy to secure your environment and keep it secured

Sponsored by: