So, the line without the variable :
Code: Select all
ie.document.getElementById("grdkonaklayan_ctl02_Sil").click()
Code: Select all
ie.document.getElementById(idstrg_appended).click()
Here is the full code:
Code: Select all
spanTags := ie.document.getElementsByTagName("span")
s := spanTags.Length
Loop % s
If (spanTags[A_Index-1].InnerText = OdaNo) { ; OdaNo is a variable coming from previous code
idstrg := spanTags[A_Index-1].Id
StringTrimRight, idstrg_trimmed, idstrg, 13
idstrg_appended = %idstrg_trimmed%_Sil
MsgBox % idstrg_trimmed ; I confirmed that I got the idstrg_trimmed right
Sleep, 500 ;lots of time to make sure that it is not a timing problem
ie.document.getElementById(idstrg_appended).click()
; ie.document.getElementById("grdkonaklayan_ctl02_Sil").click() but this one works!
break
}