Why is not working js code?

Hi


 <script src="js/jquery.js"></script>

 <!-- Bootstrap Core JavaScript -->
 <script src="js/bootstrap.min.js"></script>



 <script type="text/javascript">
setImage();

photo.oninput = setImage;

function setImage(){
 if(isUrl(photo.value))result.src = photo.value;
}

function isUrl(url){
 return /http(s?):\/\/[-\w\.]{3,}\.[A-Za-z]{2,3}/.test(url);
}
</script>
Photo<br>
<form>
<input id="photo" value><br>
<img id="result" height="500px">
</form>




The code accepts in input the link to the photo and displays it below after I pasted the link .
But it doesn't work for me . Please advice .
Let the force be with you !
August 19th 19 at 22:59
0 answer

Find more questions by tags HTMLJavaScriptjQuery