Title: JS button code
Last modified: February 11, 2020

---

# JS button code

 *  [anita1390](https://wordpress.org/support/users/anita1390/)
 * (@anita1390)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/js-button-code/)
 * I am having trouble updating the existing code so that the first button SEE OUR
   WORK goes to the OUR WORK section. I thought I labeled the section #ourwork correctly.
   TIA.
 *     ```
       (function($){
   
           "use strict"
   
         if( $('body').hasClass('home') ) {
   
           var mainTitle    = 'IMPROVE RESULTS';
           var subTitle     = 'capture attention</br>energize messages</br>build your brand'
           var buttonURL    = '#ourwork';
           var buttonLabel  = 'See Our Work';
   
           var heroContent  = '<div class="slide-inner">';
               heroContent += '<div class="contain text-slider">';
           	heroContent += '<h2 class="maintitle">'+mainTitle+'</h2>';
               heroContent += '<p class="subtitle">'+subTitle+'</p>';
              	heroContent += '</div>';
               heroContent += '<a href="'+buttonURL+'" target="_top" rel="noopener noreferrer">'+buttonLabel+'</a>';
               heroContent += '</div>';
   
           $('.sydney-hero-area').append(heroContent);
       ```
   
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fjs-button-code%2F%3Foutput_format%3Dmd%26view%3Dall&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [6 years, 4 months ago](https://wordpress.org/support/topic/js-button-code/#post-12421608)
 * Looking at your site, you are an Elementor Pro user. The author can’t have a 
   conversation with customers here. That’s not permitted for anyone.
 * For pro or commercial product support please contact the author directly on their
   site. This includes any pre-sales topics as well.
 * As the author is aware, commercial products are [not supported in these forums](https://wordpress.org/support/guidelines/#do-not-post-about-commercial-products).
   I am sure they will have no problem supporting you there.

Viewing 1 replies (of 1 total)

The topic ‘JS button code’ is closed to new replies.

 * ![](https://ps.w.org/elementor/assets/icon-256x256.gif?rev=3444228)
 * [Elementor Website Builder - more than just a page builder](https://wordpress.org/plugins/elementor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/elementor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/elementor/)
 * [Active Topics](https://wordpress.org/support/plugin/elementor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/elementor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/elementor/reviews/)

## Tags

 * [button](https://wordpress.org/support/topic-tag/button/)
 * [js](https://wordpress.org/support/topic-tag/js/)

 * 1 reply
 * 1 participant
 * Last reply from: [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * Last activity: [6 years, 4 months ago](https://wordpress.org/support/topic/js-button-code/#post-12421608)
 * Status: not resolved