jQuery addClass example
Change class name on click in jQuery
HTML
<link rel="stylesheet" href="//assets.onestore.ms/cdnfiles/external/mwf/long/v1/v1.15.0/css/mwf-west-european-default.min.css">
<link rel="stylesheet" href="//assets.onestore.ms/cdnfiles/external/mwf/long/v1/v1.15.0/css/mwf-west-european-default.min.css">
<table>
<tbody>
<tr>
<td>
<!-- I do not want to put margin-right hardcoded like this. It should come dynamically or fix with other CSS properties -->
<i class="glyphicon glyphicon-calendar"></i>
<input value="04/29/2018 12:00 AM" class="sfr-ip-start-date c-text-field Control x-hidden-focus" id="StartDate1" type="text" style="cursor: pointer;width:250px;font-size:13px">
</td>
<td>
<!-- I do not want to put margin-right hardcoded like this. It should come dynamically or fix with other CSS properties -->
<i class="glyphicon glyphicon-calendar"></i>
<input value="04/29/2018 12:00 AM" class="sfr-ip-start-date c-text-field Control" id="StartDate2" type="text" style="cursor: pointer;width:170px;font-size:13px">
</td>
</tr>
</tbody>
</table>
CSS
td {
position: relative;
}
input.c-text-field[type=text],
input[type=email] {
display: block;
width: 276px;
height: 36px;
margin-top: 20px;
padding: 7px 10px;
border: 1px solid rgba(0, 0, 0, .6);
outline: 0;
background: #FFF;
}
.glyphicon {
position: absolute;
right: 5px;
width: 36px;
color: #0379d3!important;
}
.glyphicon-calendar {
pointer-events: none;
margin-top: 20px;
}
.glyphicon-calendar:after {
font-family: MWF-MDL2;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
content: "\E787";
display: block;
font-size: 26px;
height: 36px;
line-height: 36px;
text-align: right;
}
.c-checkbox label.c-label,
input.c-text-field[type=text],
table .c-checkbox label.c-label {
margin-top: 0;
}