-1
I got the following <input>
and <img>
on the page.
<input class="form-control" id="cordenadasaqui" value="47644.63956 74592.843" readonly>
<img id="imagemaqui" src="http://www.meusite.com/los-santos.jpg">
I need to display a different image for each set of displayed strings.
Example
If the
<input>
above is with the value=" "
containing in the first 11 characters:
47644.63956
the image displayed will be:
<img id="imagemaqui" src="http://www.meusite.com/los-santos.jpg">
If you have the
value=" "
containing the following numbers in the first 11 characters:
87635.98456
the image displayed will be:
<img id="imagemaqui" src="http://www.meusite.com/las-venturas.jpg">
To simplify the question
In the
value=" "
a set of numbers will be loaded, and then only the first 11 characters (10 numbers and 1 point ".").
If these first 11 characters are 47644.63956
= los-santos.jpg
If these first 11 characters are 87635.98456
= las-venturas.jpg
And so on... How to do this?
values will already be filled in the input? or when the user type the image will appear?
– LocalHost
They will already be filled in the input friend :D
– Alexandre Lopes
intends to use js?
– LocalHost
I think it would be an alternative. :)
– Alexandre Lopes
I’ll make a code here and already answer your question...
– LocalHost
Thank you friend! D
– Alexandre Lopes