簡體   English   中英

我無法在新打開的窗口中清除表單輸入值

[英]I'm unable to clear the form input values in the newly opened window

第一行代碼中 ,打開一個加載表單的URL。

var w = window.open(url);

第二行代碼中 ,我試圖擦除新打開的窗口中表單的所有輸入值。

w.window.jQuery("#employer").find('input:text, input:password, input:file, select, textarea').val(' ')

第三行代碼中 ,我試圖打印其輸入值已被刪除的表格。

w.window.print();

使用w.window.jQuery()不會使它在w.window()搜索文檔。 您需要將其作為參數傳遞給jQuery

jQuery("#employer", w.document).find(('input:text, input:password, input:file, select, textarea').val(' ');

請注意,這僅在窗口的URL與原始頁面相同的情況下才有效。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM