Chaine de caractères

In this example below you will see how to do a Chaine de caractères with some HTML / CSS and Javascript

https://openclassrooms.com/forum/sujet/chaine-de-caracteres-18

Thumbnail
This awesome code was written by Deejayfool, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright Deejayfool ©

Technologies

  • HTML
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>Chaine de caractères</title>
  
  
  
  
  
</head>

<body>

  <input type="text" id="input" />

<span id="test"></span>
  <script src='https://code.jquery.com/jquery-2.2.4.min.js'></script>

  

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




</body>

</html>

/*Downloaded from https://www.codeseek.co/Deejayfool/chaine-de-caractandxe8res-QEVkEP */
var pattern = /([a-zA-Z])\1{3}/;

$('#input').on('change keyup paste', function(){
  var value = $(this).val();
  $('#test').text(pattern.test(value));
});

Comments