0
I have the following code you click on input that has the image URL:
<input name="miniatura" value="<?php echo $miniatura;?>" class="miniatura">
<img id="miniatura_exibe" />
//carregar url de imagem
$(document).on('click','.miniatura',function(){
var valor = $(this).val();
$('#miniatura_exibe').attr('src', valor);
});
How do I stop instead of displaying the image at the click of the input, display on the page load? I’ve tried $(document).on('ready','.miniatura',function(){
I couldn’t. I don’t know if it works that way.
Use the Jquery in:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
Blz. It worked fine. And how do I, if I change the image url in the inout already load? Without pulling the bank, just change the url. Simple thing. It would change, but it doesn’t happen here.
– Rod
You’d have to make a change anyway.
– Sam
$(Document). on('change','.miniatura',Function(){ thus?
– Rod
You can simplify this by: https://jsfiddle.net/mc1keLp9/
– Sam
You’re the man. Fight buddy.
– Rod