var myInput = document.getElementsByTagName('input')[0]; //только вот тут нада условие выбора, какой конкретно инпут
if (myInput.parentElement.classList.contains('active')) //вот тут мы берем наш инпут, смотрим его предка. У предка просим список классов и проверяем, есть ли в списке наш
{
console.log(myInput.checked);
/////magic here
}
function validateform(){
if ( document.contact_form.elements.email.value == "" )
{
alert("Email ");
return false;
}
if ( document.contact_form.elements.login.value == "" )
{
alert("Login ! ");
return false;
}
}
<form name="contact_form" onsubmit="return validateform()" method="post" class="s-form validateble register_form" action="loading.php">
<div class="title">Înregistrare</div>
<div class="s-field ">
<div class="text-wrapper">
<input type="email" value="" tabindex="1" placeholder="E-mail" name="email" />
<div class="icon_email"></div>
</div>
</div>
<div class="s-field ">
<div class="text-wrapper">
<input type="text" value="" tabindex="2" placeholder="Loginul" name="login" />
<div class="icon_username"></div>
</div>
</div>
<div class="s-field">
<div class="text-wrapper">
<input type="password" value="" tabindex="3" placeholder="Parola" name="password" />
<div class="icon_password"></div>
</div>
</div>
<div class="s-field">
<div class="text-wrapper">
<input type="password" value="" tabindex="4" placeholder="Parola inca o data " name="password2" />
<div class="icon_password"></div>
</div>
</div>
<div class="s-buttons">
<input type="submit" value="Înregistrare" class="button big green wide enable"></input>
</div>
</form>
The difference between disabled and readonly is that read-only controls are still focusable, so the user can still select the text and interact with it, whereas disabled controls are entirely non-interactive. (For this reason, only text controls can be made read-only: it wouldn't make sense for checkboxes or buttons, for instances.)
#octagon {
width: 100px;
height: 100px;
background: red;
position: relative;
}
#octagon:before {
content: "";
position: absolute;
top: 0;
left: 0;
border-bottom: 29px solid red;
border-left: 29px solid #eee;
border-right: 29px solid #eee;
width: 42px;
height: 0;
}
#octagon:after {
content: "";
position: absolute;
bottom: 0;
left: 0;
border-top: 29px solid red;
border-left: 29px solid #eee;
border-right: 29px solid #eee;
width: 42px;
height: 0;
}
$amount.on('input', function() {
if(this.value == "") this.value = 0; //например, вот так. Если значение пустое, ставить 0
$rangeslider.val(this.value).change();
});
У меня есть 3 одинаковых кусочка кода для 3 дивов со своими айди.- в коде нигде не упоминается айди
$('.panel-heading.slide a').click(function() {
if ($(this).hasClass('open')) {
/*...*/
} else {
/*...*/
}
});
<div class="input-group">
<input type="text" class="form-control" placeholder="Search for...">
<span class="input-group-btn">
<button class="btn btn-default" type="button">Go!</button>
</span>
</div>
<div class="container">
<div class="row">
<input type="text" class="form-control" placeholder="Login">
</div>
<div class="row">
<div class="input-group">
<input type="text" class="form-control" placeholder="Password">
<span class="input-group-btn">
<button class="btn btn-default" type="button">Log in</button>
</span>
</div>
</div>