find attribute values in xml tag python code example
Example 1: js get data attribute
var element = document.querySelector('.element');
var dataAttribute = element.getAttribute('data-name');
// replace "data-name" with your data attribute name
console.log(dataAttribute);
Example 2: react set multible attribute values
render () {
const attributes = {
className: 'form-input form-input--email',
id: 'user-email',
type: 'email',
name: 'user-email',
placeholder: this.props.placeholder,
required: this.state.required
}
return <div className='form-field'>
<label className='form-label' htmlFor='user-email'>Email: </label>
<input {...attributes}>
</div>
}