Get or Set a hashtag with .hashtag()

.hashtag()


Description: Get or Set the URL hashtag .


Example:

<!doctype html>
    <html lang="en">
    <head>
      <meta charset="utf-8">
      <title>hashtag demo</title>
      <script src="http://code.bitsycode.com/bitsycode-latest.min.js"></script>
    </head>
    <body>
        
        <div class="result"></div>
        
        <script>
            
            bitsyCode.ready(function(){ // CHECK IF DOCUMENT READY
                bitsyCode.hashtag("BitsyCode"); //SET HASH TAG
                bitsyCode(".result").html(bitsyCode.hashtag()); //RETRIEVE HASH TAG
            })
            
        </script>
     
    </body>
    </html>

Preview:

Hashtag:


 



Result:
  • Usage

    • How to use:

      "hashtag" allows you to get and set hashtag values in the URL.

    • GET:

      bitsyCode.hashtag();
    • SET:

      bitsyCode.hashtag("my_hashtag");
  • Options

    • What options are there:
      value: "" (default value) // Allows you to set a value to change the hashtag to.
  • Returns

    • RETURNS:

      The GET returns the hashtag value.

Share