Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

set className with ref react

class Test extends Component {
    constructor(props){
        //codes
    }

    hide = () => {
        const span = this.refs.spanLoading;
        span.ClassName = "hidden";
    }

    render() {

        return (
            <span ref="spanLoading" id="test-id" className="">The Quick Brown Fox.</span>

            <button onClick={() => this.hide()}>Hide</button>
        );
    }
}

export default Test;
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript error null 
Javascript :: How to Define a Function using a Function Expression in javascript 
Javascript :: initiate node js app 
Javascript :: for of loop in javascript 
Javascript :: id in class selector jquery 
Javascript :: javascript array methods cheat sheet 
Javascript :: css striped background 
Javascript :: find the second largest number in array javascript 
Javascript :: mongodb aggregate $filter check if exists 
Javascript :: how to remove the elements from array and how to replace a new element in javascript 
Javascript :: types of method in js 
Javascript :: dual array javascript 
Javascript :: form action using react 
Javascript :: is javascript loosely typed 
Javascript :: Looping arrays with for loop 
Javascript :: combine all ts files into one js 
Javascript :: jquery view image in codeigniter 
Javascript :: (function (g, d, a) {})(window, document, jQuery); 
Javascript :: node js write read string to file 
Python :: python create new folder if not exist 
Python :: python today - 1 day 
Python :: remove all pyc 
Python :: dataframe to csv without ids 
Python :: time format conversion in python 
Python :: mac upgrade python to 3.8 
Python :: python copy paste file 
Python :: colab im show 
Python :: matplotlib.pyplot imshow size 
Python :: split data validation python 
Python :: get common elements from two lists 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =