/    Sign up×
Community /Pin to ProfileBookmark

hiding a button

Hello,

Not sure why this code won’t work.. Im trying to hide this button:

<a href=”#” _**class=”btn button-sidebar-wide crosslist_link”>**_<i class=”icon-off”></i> Cross-List this Section</a>

<a href=”/courses/2420/settings” class=”btn button-sidebar-wide”><i class=”icon-settings”></i> Back to Course Settings</a>

This is my code, why is it not working???

$(document).ready(function(){
// Checks the page to make sure it is course settings
if (/^/courses/[0-9]+/settings$/.test(window.location.pathname)) {
// Checks that current user role is not an admin to hide/disable options. Admins can access all settings.
if($.inArray(‘admin’,ENV.current_user_roles) == -1){
// Hides course delete button
$(‘a[href*=’confirm_action?event=delete’]’).hide();
// Hides course reset button
$(‘a[href*
=’/reset’]’).hide();
// Hides cross listing
**_$(‘a.btn.button-sidebar-wide.crosslist_link’).hide();
$(“input#course_section_name”).hide();
$(“input#course_section_name”).parent().hide();_
**

}
}

});

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@mamoun_bashierJun 28.2019 — you want a button to be hidden when you click on it ? or hidden when load the page ?
Copy linkTweet thisAlerts:
@cindeeauthorJun 28.2019 — Hi Mamoun_bashier, its when you load the page.
×

Success!

Help @cindee spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...