how to define dynamic getelementbyid in code? : We can use this code to get id :

    document.getElementById("exampleid").value = 1;

and for example page code is 

    <input id="exampleid" value="" />

but we cannot use high code for this once . because id is different .

    <input id="exampleid2" value="" />

and we should change our code to 

    document.getElementById("exampleid2").value = 1;

now , how can we define dynamic id ? like : 

    document.getElementById('/^exampleid/').value = 1;

note , We do not want every time Change the code when html id changed .
