Vanilla JS to close notification bar in WordPress

Question

I have created a notification bar that is sticky with the Close button. I am using Top Bar Widget in GeneratePress.
Top Bar with Close Button

I was able to do with the jquery code.

jQuery(document).ready(function($){
    $(".close-btn").click(function(){
      $(".top-bar").hide();
    });
});

Is there any way to close the notification bar with Vanilla JS?

0
Suraj 3 years 2020-07-19T09:10:43-05:00 0 Answers 31 views 0

Leave an answer

Browse
Browse