this.users.find(user => user.first === first && user.last === last)
// user || undefined
form.addEventListener('submit', function(evt) {
evt.preventDefault();
// ничего не делаем
if (document.querySelector('#hidden').value) return
let formData = {
name: document.querySelector('input[name="name"]').value,
phone: document.querySelector('input[name="phone"]').value,
email: document.querySelector('input[name="email"]').value,
textarea: document.querySelector('textarea[name="textarea"]').value,
};
var request = new XMLHttpRequest();
x = document.querySelector('#myTopnav')
x.classList.toggle('responsive')
class Parent extends React.Component {
state = { c2: null }
comp2state = state => { this.setState({ c2: state }) }
return (
<>
<ComponentOne c2state={this.state.c2} />
<ComponentTwo onStateChange={this.comp2state} />
</>
)
}
class ComponentTwo extends React.Component {
state = { bla: '' }
onChange = e => {
this.setState(
{ bla: e.target.value },
() => this.props.onStateChange(this.state)
)
}
return (
<input value={this.state.bla} onChange={onChange} />
)
}
.tns-slide-active:first-of-type {
transform: translateX(-50%);
}
.tns-slide-active:last-of-type {
transform: translateX(50%);
}
БЕКЕНД NODE.JS ВЕБ-РАЗРАБОТКА JAVASCRIPT