Yes, you can do that providing you have value defined, the inner expression '#loanAmmount-' + value will be evaluated first.
Are you having a specific problem?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have defined an element id in the following way:
id="loanAmmount-{{ $loop->index + 1 }}"
How do I grab the value in Jquery if I know the value part (the number I generate in the loop).
Can I do something like this:
var loanAmmount = $('#loanAmmount-' + value).val();
Yes, you can do that providing you have value defined, the inner expression '#loanAmmount-' + value will be evaluated first.
Are you having a specific problem?
Please or to participate in this conversation.