<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1"/> <link rel="stylesheet" type="text/css" href="css/bootstrap.css"/> </head> <body> <nav class="navbar navbar-default"> <div class="container-fluid"> </div> </nav> <div class="col-md-6 well"> <hr style="border-top:1px dotted #ccc;"/> <div class="col-md-6"> </div> </div> </body> </html>
var toggle=false; var hide=document.getElementById("hide"); var image=document.getElementById("image"); hide.onchange = function(){ if(!toggle){ toggle=true; image.src="images/default.png"; }else{ toggle=false; image.src="images/profile.png"; } }