Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Learn jQuery with Example

<!DOCTYPE html>
<html>
<head>
</head>
<body>

<script type="text/javascript">
function changeText2(){
    var userInput = document.getElementById('userInput').value;
    var lnk = document.getElementById('lnk');
    lnk.href = "https://www.pexels.com/search/" + userInput;
    lnk.innerHTML = lnk.href;
    var lnk2 = document.getElementById('lnk2');
    lnk2.href = "https://www.unsplash.com/search/" + userInput;
    lnk2.innerHTML = lnk2.href;
}
function Pexels() {
  // Get the checkbox
  var checkBox = document.getElementById("myCheck");
  // Get the output text
  var text = document.getElementById("text");

  // If the checkbox is checked, display the output text
  if (checkBox.checked == true){
    text.style.display = "block";
  } else {
    text.style.display = "none";
  }
}
function Unsplash() {
  // Get the checkbox
  var checkBox = document.getElementById("myCheck2");
  // Get the output text
  var text = document.getElementById("text2");

  // If the checkbox is checked, display the output text
  if (checkBox.checked == true){
    text.style.display = "block";
  } else {
    text.style.display = "none";
  }
}
</script>
Pexels: <input type="checkbox" id="myCheck" onclick="Pexels()"><br>
Unsplash: <input type="checkbox" id="myCheck2" onclick="Unsplash()"><br>

<p id="text" style="display:none"><a href="" id=lnk>nothing here yet</a></p>
<p id="text2" style="display:none"><a href="" id=lnk2>nothing here yet</a></p>
<input type='text' id='userInput' value=' ' />
<input type='button' onclick='changeText2()' value='text'/>
</body>
</html>

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.