若要修改第二个li的文字为‘Hello’怎么修改
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<ul class="list">
<li>list1</li>
<li>list2</li>
</ul>
</body>
</html>
js代码
document.querySelectorAll('.list li')[1].textContent = 'Hello!'