css - Modify HTML Element -
i don't know proper jargon, there way modify html element using vba? consider following example:
<span class="display">hh</span>
is there way change value "hh" else via vba? i've been working on several hours now, , lack of html knowledge severely limiting progress... latest attempts involved trying set attributes of element, realized going issue wrong way. i'm @ loss.
i'm trying change value of drop down list (in surveymonkey), drop down isn't other drop down lists i've seen.
the code drop down lists follows:
<span class="timepicker btn-menu"> <a href="#" class='btn btn-small hour-menu-btn btn-menu-left select-menu'> <span class='display'></span><span class="arrow smf-icon">–</span> </a> <a href="#" class="btn btn-small minute-menu-btn btn-menu-right select-menu"> <span class='display'></span><span class="arrow smf-icon">–</span> </a> <a class="btn btn-small ampm-menu-btn btn-menu-right select-menu"> <span class='display'></span><span class="arrow smf-icon">–</span> </a> </span>
i used use code change hour setting:
objie.document.getelementbyid("ddlhour").selectedindex = 6
but there's no id, , run time error 438: object doesn't support property or method
when try getelementsbyclassname
instead of getelementbyid
. appreciated!
edit
both lines below raise following error: "object variable or block variable not set"
d.getelementsbyclassname("btn btn-small hour-menu-btn btn-menu-left select-menu").item(1) = 6 d.getelementsbyclassname("btn btn-small hour-menu-btn btn-menu-left select-menu").item("display") = 6
"d" html document (and set). tried adding .selectedindex = 6
end, got same error.
the following error raised if use below line of code: "object doesn't support property or method"
d.getelementsbyclassname("btn btn-small hour-menu-btn btn-menu-left select-menu").item(0) = 6
am doing wrong?
Comments
Post a Comment