Getting the parent div of element

This should be really simple but I’m having trouble with it. How do I get a parent div of a child element? My HTML: <div id=”test”> <p id=”myParagraph”>Testing</p> </div> My JavaScript: var pDoc = document.getElementById(“myParagraph”); var parentDiv = ?????????? I would have thought document.parent or parent.container would work but I keep getting not defined errors. … Read more

How to access a DOM element in React? What is the equilvalent of document.getElementById() in React

How do I select certain bars in react.js? This is my code: var Progressbar = React.createClass({ getInitialState: function () { return { completed: this.props.completed }; }, addPrecent: function (value) { this.props.completed += value; this.setState({ completed: this.props.completed }); }, render: function () { var completed = this.props.completed; if (completed < 0) { completed = 0 }; … Read more