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

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -