Link to home
Start Free TrialLog in
Avatar of tolppa
tolppa

asked on

IE: getelemetnbyid does not work.

Hello. I am not able to get select element using IE10. These both will fail:

var object = $('#bfl12_ctl34_g_44633362_5r67_4fbb_9f69_53252263626_ctl02_ctl06_ctlxx')[0];
var object = document.getElementById("bfl12_ctl34_g_44633362_5r67_4fbb_9f69_53252263626_ctl02_ctl06_ctlxx");

Open in new window


I do not have problem with firefox. Also IE works correctly with an another select element. Whats wrong? I need slect element because it will be used later on my code.
SOLUTION
Avatar of Insoftservice inso
Insoftservice inso
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tolppa
tolppa

ASKER

This should be enought to check if javascript will get the data:

//window.onload = function()
$(document).ready(function(){
    setTimeout(function(){
        var object = $('#bfl12_ctl34_g_44633362_5r67_4fbb_9f69_53252263626_ctl02_ctl06_ctlxx')[0];
alert(object .value); 
    }, 5000);
});

Open in new window


I will see what happens.
Avatar of tolppa

ASKER

Problem was that my CMS changed select element to custom control when there was more than 20 options.