Advertisement
7zgi

jquery send mail

Jan 15th, 2020
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.02 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
  5. <script>
  6. $(document).ready(function(){
  7.        $('#table > tbody > tr').not('tr:first').click(function(i){
  8.           window.name = $(this).find('td:eq(0)').text();
  9.           window.mail = $(this).find('td:eq(1)').text();
  10.           window.number = $(this).find('td:eq(2)').text();
  11.           window.group = prompt('To who ?');
  12.           window.msg = 'Hi Mr.' +window.name + '\n\nWe will check your request right now';
  13.           $(this).find('a').attr(
  14.           'href' , 'mailto:'+window.mail+'&cc='+window.group+'&subject='+window.number+'&body='+window.msg);
  15.        });
  16.        
  17.        
  18.          
  19. });
  20. </script>
  21. </head>
  22. <body>
  23.  
  24. <table id='table'>
  25. <tbody>
  26. <tr><th>name</th> <th>mail</th> <th>phone</th></tr>
  27. <tr><td><a href='#'>salim</a></td> <td>s.f@outlook.com</td> <td>987</td></tr>
  28. <tr><td><a href='#'>ali</a></td> <td>a.f@outlook.com</td> <td>123</td></tr>
  29. </tbody>
  30. </table>
  31.  
  32. </body>
  33. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement