Answers for "change part of url"

0

change part of url

<!DOCTYPE html>
<html>
  
<head>
    <title>
        How to remove a character from 
        string using Javascript?
    </title>
</head>
  
<body>
    <h1 style="color: green">
        GeeksforGeeks
    </h1>
      
    <b>
        How to remove a character from
        a string using Javascript?
    </b>
      
    <p>Original string is GeeksforGeeks</p>
      
    <p>
        New String is: 
        <span class="output"></span>
    </p>
  
    <button onclick="removeCharacter()">
        Remove Character
    </button>
      
    <script type="text/javascript">
        function removeCharacter() {
            originalString = 'GeeksForGeeks';
            newString = originalString.replace('G', '');
  
            document.querySelector('.output').textContent 
                    = newString;
        }
    </script>
</body>
  
</html>
Posted by: Guest on January-18-2022

Code answers related to "change part of url"

Browse Popular Code Answers by Language