I am using javascript to fetch data from a text box using js.eval() function like :
val amount=js.eval("document.getElementById('amount').value;")
It is working fine when I am writing the id directly i.e. 'amount' in this case. But I want to create a function which will receive the id and then use the variable id. I tried using '$' sign also like :
def getAmount(amount_id:String):Unit={
println("Amount is : "+js.eval(s"document.getElementById(${id}).value;"))
But it is not working. Any suggestions ?