arkam chou
asked on
Get value from HTML Tag (span)
Dear All,
How can I get value from span?
How can I get value from span?
<form action="" method="POST">
<span id="test">2015-06-10 - 2015-06-21</span>
</form>
ASKER
yes, I want to submit that value with php. I want to get date value from span in bootstrap-datepicker and submit that value to php.
https://bootstrap-datepicker.readthedocs.org/en/latest/options.html
https://bootstrap-datepicker.readthedocs.org/en/latest/options.html
ASKER
can I transfer value from span to hidden textbox when have any change on span? if can, how to do it?
can I transfer value from span to hidden textbox when have any change on span?I don't understand - <span> is not an input element - it contains static text so not sure what you mean when you say "have any change on span"?
ASKER
I use https://bootstrap-datepicker.readthedocs.org/en/latest/options.html
when I pick any date, it will give value to span. so I want to use that value in span with form.
when I pick any date, it will give value to span. so I want to use that value in span with form.
when I pick any date, it will give value to spanA) How?
B) Why?
Why are you assigning a date to a span and not an input element?
ASKER
I not assign it myself. I use date-picker from this web https://bootstrap-datepicker.readthedocs.org/en/latest/options.html
and I saw when I pick date, the value was change in span.
and I saw when I pick date, the value was change in span.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
var s = document.getElementById('t
var d = document.getElementById('t
With JQuery
var x = $('#test').text();
var y = $('#test').html();
If you want to submit the value with the form and retrieve it on the server - can't