---
title: "Struts 表单中name含有点号 jQuery选择器选择不到 解决"
author: "lgh06"
date: "2015-04-03T15:06:00Z"
tags: []
slug: "struts-name-jquery"
draft: false
lastmod: "2015-07-10T02:28:01Z"
id: 2225976
url: "https://lgh06.iteye.com/blog/2225976"
---

```
console.log($('#user.password').val())
```

写成这样不管用

需要对.和:进行转义。加上\\\\即可。

```
console.log($('#user\\.password').val())
```

OK。

问题解决

版权声明：本文为博主原创文章，未经博主允许不得转载。