Missing jQuery library in your fiddle, there is no error in your code . Just include jQuery library in your code
$(document).ready(function() {
$(".second_div").css({
'width': ($(".first_div").width() + 'px')
});
});
.second_div,
.first_div {
border: 1px solid black;
padding: 2px 4px;
display: inline-block;
}
First Div
Second.width == First.width