SHARE
TWEET

Untitled

a guest Sep 21st, 2019 103 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function searchfrnd(){
  2.     var searchString = document.getElementById('validate').value;
  3.     var elements = document.getElementsByClassName('username')
  4.  
  5.     document.getElementById('wrapper').style.display = "none";
  6.     document.getElementById('searchrslts').style.display = "block";
  7.  
  8.     var isFound = 0;
  9.    
  10.     for (var i = 0; i < elements.length; i++) {
  11.         if (elements[i].innerHTML.indexOf(searchString) !== -1) {
  12.             isFound = 1;
  13.             document.getElementById('results').innerHTML = '<img src="images/user3.png" class="image" width="100" height="100"><br><br><p id="resultName"></p><br><a href="" ><button class="btn1" onclick="getUserData()"><i class="fa fa-users"></i>Add friends</a></button><br><br><a href="contact.html" ><button class="btn2"><i class="fa fa-envelope"></i>Send massage</a></button><br><br><a href="contact.html" ><button class="btn3"><i class="fa fa-edit"></i>View profile</a></button><br></br>';
  14.             document.getElementById('resultName').innerHTML = searchString;
  15.             break;
  16.         }
  17.     }
  18.  
  19.     if (isFound == 0) {
  20.         document.getElementById('results').innerHTML = "No results";
  21.     }
  22.  
  23. }
  24.  
  25. document.getElementById('button').addEventListener('click',function()
  26. {
  27.     document.querySelector('.modal-bg').style.display = 'flex';
  28. }
  29. );
  30.  
  31. document.querySelector('.close').addEventListener('.click',function(){
  32.     document.querySelector('.bg-modal').style.display = 'none';
  33. });
  34.  
  35. /*
  36. var userID;
  37.  
  38. function getUserData(){
  39.     userID = "Saranga";
  40.     var i = userID;
  41.     window.open("contacts.html","_self");
  42. }
  43.  
  44. function writeData(){
  45.         var id = userID;
  46.         document.getElementById('newUser').innerHTML = '<img src="images/user3.png" class="image" width="70" height="70"><p id="un1"></p><button class="BUTTON" ><i class="fas fa-comment-alt"></i>Start chat</button>';
  47.         document.getElementById('un1').innerHTML = id;
  48.    
  49. }*/
  50.  
  51.  
  52.  
  53.  
  54. function closeRslts(){
  55.     document.getElementById('searchrslts').style.display = "none";
  56.     document.getElementById('wrapper').style.display = "flex";
  57. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top