2
Answers

How to get html label text in PHP session or in variable ?

Ajit N

Ajit N

5y
4.1k
1
hello, i designed an html page, in that i have a lable. 
  1. <label id="lblrs"  class="mt-3">Rs.50</label>    
from lable the text which is "Rs.50" ,i want to store it in Php variable or in session.
In php i tried this below code
  1. $getrs='<script>var price = document.getElementById("lblrs").textContent;</script>';  
and this one also
  1. $getrs='<script>var price = document.getElementById("lblrs").value;</script>';  
 But i didn't get text of lable.
so help me how can i do this ? 
Answers (2)