---
title: "如何获取页面上的值"
author: "summerlin"
date: "2015-05-05T11:50:16Z"
tags: []
categories: ["Web前端"]
slug: "untitled"
draft: false
lastmod: "2015-05-05T11:55:10Z"
id: 2208531
url: "https://summerlin.iteye.com/blog/2208531"
---

//通过name属性获得上级页面的值 name=’‘N\_NAME“

var NAME=window.opener.document.form1.N\_NAME.value;

 

//通过id获得页面上的值 id=‘’n\_password‘

var password=document.getElementById("n\_password").value