MCQs > IT & Programming > JavaScript > Which code snippet will trigger an input type='file' attribute when an element with a 'newbtn' ID is clicked?

JavaScript MCQs

Which of the following code snippets will trigger an input type="file" attribute when an element with a "newbtn" ID is clicked? <button id"newbtn" onclick="grt();">Upload</button> <form> <input id="thisId" type="file" name="upload" /> </form> </form>

Answer

Correct Answer: function grt(){document.getElementById('thisId').click();}

Explanation:

Note: This Question is unanswered, help us to find answer for this one

JavaScript Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

JavaScript Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it