Search
 
SCRIPT & CODE EXAMPLE
 

HTML

html pass attribute to react

<div id="container" data-title="Hello" data-name="World">
    <!-- This element's contents will be replaced with your component. -->
</div>

--------------------------------------------------------------------------

var Hello = props => (
    <div>{ props.title}, { props.name }</div>
);

var root = document.getElementById('container');

ReactDOM.render(
  <Hello {...(root.dataset)} />,
  root
);
Comment

PREVIOUS NEXT
Code Example
Html :: form mobile number validation 
Html :: html postsql 
Html :: html code element 
Html :: bootstrap loader in os 
Html :: aria-describedby and role 
Html :: iam making a disable button , when I click on it disable it and the write please wait on this button in jQuery 
Html :: Análise de erros - Serviços 
Html :: set the html of the .template-target to be the the html from the template element. 
Html :: what is com.apple.parsecd 
Html :: Creating Github logo with CSS 
Html :: html programming language 
Html :: html entity decode in sql query 
Html :: force line label no wrap 
Html :: kodingan menambahkan judul isi di html 
Html :: repeat task multicraft 
Html :: HTML entities must be escaped 
Html :: coding html ide online 
Html :: html div syntax 
Html :: Bootstrap 5.0 Container 
Html :: later synonym 
Html :: error: serializer for text/html; charset=utf-8 doesn 
Css :: How to make a backgroud image with no repeat in html 
Css :: react inline css background color 
Css :: center postion absdolute 
Css :: how to make text bold in css 
Css :: center a div css 
Css :: center div horizontally and vertically 
Css :: html table td spacing 
Css :: css circle 
Css :: detect mobile css 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =