javascript - How to click a save as html link with changing ID's? -
i know how click link using javascript,
document.getelementbyid('yourlinkid').click();
but if id changing or not sure id going be? have html link auto generate grid of data excel file once click on give me link "click" , save file. idea's or other way of click html link?
here example html:
<a href="getyourfile..." id="myidisalwayschanging-1234">click</a>
you can use class kind of button, when slect $('.class-name')
can cause clicking on multiple links.
other solution traverse dom (ie. using jquery) https://api.jquery.com/category/traversing/tree-traversal/
you can use function move between elements:
$( "li" ) .closest( "ul" )
Comments
Post a Comment