javascript - Hide an element in a class - where do I add the code to hide the element? -


i've discovered post want accomplish on owncloud server - hide second element within class

from suggested answers (there many), last comment said following needed:

.fileactions > a:nth-child(2) {   display: none; } 

my question is...where put bit of code? can't tell answer put this? have .js file in owncloud called fileactionsspec.js. it's place i've found code words action-download in them. add code:

.fileactions > a:nth-child(2) {    display: none; } 

to end of .js file?

thanks.

you not supposed put in js file. need add in css file, say: style.css , style.css file should referenced as:

<link rel="stylesheet" href="style.css" /> 

the above code has added <head> section of html page.

if need js approach, need add this:

var css = '.fileactions > a:nth-child(2) {display: none;}',     head = document.head || document.getelementsbytagname('head')[0],     style = document.createelement('style');  style.type = 'text/css'; if (style.stylesheet){   style.stylesheet.csstext = css; } else {   style.appendchild(document.createtextnode(css)); }  head.appendchild(style); 

and css says that, said jaaaaaaay:

<div class="fileactions">    <a>this visible</a>    <a>this invisible</a> <!--it hide one--> </div> 

hope helps. please read introduction html , css.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -