var vehicleType = document.getElementById('Vehicle_Type');
var obj = vehicleType;
var objVal = obj.value;
var node = obj.parentNode;
I believe there’s some problem with obj.value….is there any way where i can get the DOM object of the element on the page called ‘Vehicle Type’?
Danke,
Both
vehicleTypeandobjreference the actual DOM element, however the call to.valuemay not be appropriate.Depending on what type of element this is, you may not actually have a
.valueproperty. The.valueproperty is generally found on various form elements.If you’re wanting to get the text contents of the element, you should instead try
.textContentor.innerTextinstead.Additionally, make sure you have your elements’ id attribute set properly. If you’re running the following:
This will look for an element having the attribute
id='Vehicle_Type'.