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

This topic contains 1 reply, has 2 voices, and was last updated by  Ossian 1 year, 7 months ago.

Viewing 2 posts - 1 through 2 (of 2 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]


    Ossian
    Moderator
    #191643

    Moved to more appropriate forum

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.