I have seen various post allowing user to do this by including the var as part of the url something like this
http://127.0.0.1:8000/?var1="var1"+var2="var2"
But in my case I need to send the variable into href tag which goes to views function in my django app
<a href="{% url 'process-payment'>
I have the variable set like this:
<td><strong>Rs.<span id="totalPrice">{{ order.get_cart_total}}</span></strong></td>
.
.
<a href="{% url 'process-payment'>
.
<script>
var totalPrice = document.getElementById("totalPrice").innerHTML; //picking a value through innerHTML
</script>
Can anyone help me build this url so the value goes to views function
urls.py
urlpatterns=[
path('payment/',views.process_payment, name='process-payment'),
]