Skip to content
TheChatArchiveThe Chat Archive
gpt-3.5-turbo-0613· OpenAIAi2 WildChat-4.8M (AI2)

can you gibe me the jquery script to wrap the class mec-event-sharing-wrap and…

  1. User

    can you gibe me the jquery script to wrap the class mec-event-sharing-wrap and mec-booking-button in to a new dic with the class name of test

  2. Assistant

    Sure! Here is a jQuery script that wraps the elements with class "mec-event-sharing-wrap" and "mec-booking-button" into a new div with the class name "test":

    $(document).ready(function() {
      // Create a new div element with class "test"
      var newDiv = $("<div>").addClass("test");
      
      // Find all elements with class "mec-event-sharing-wrap" and "mec-booking-button"
      var elementsToWrap = $(".mec-event-sharing-wrap, .mec-booking-button");
      
      // Wrap the found elements with the new div
      elementsToWrap.wrapAll(newDiv);
    });
    

    You can place this script within the <script></script> tags in your HTML file or within your JavaScript file. Ensure that jQuery is included before adding this script.