var val = $('input#valInput').val();
$('input#valInput').val('value');
<!doctype html>
<html lang="ko">
<head>
<meta charset="utf-8">
<title>val</title>
</head>
<body>
<p><input type="text" id="valInput"> <button>Click</button></p>
</body>
</html>