社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
私信  •  关注

Adrian Brand

Adrian Brand 最近创建的主题
Adrian Brand 最近回复了
6 年前
回复了 Adrian Brand 创建的主题 » jQuery从函数发送和接收数据
replace("h","m");

你想用m代替h

replace("H","m");
7 年前
回复了 Adrian Brand 创建的主题 » 这两个javascript和jquery语句有什么区别?

document.getElementByID返回一个具有传入字符串ID的DOM对象。$(cssseelector)返回一个jquery对象,该对象包含一组与css选择器匹配的dom对象,在您的情况下,是具有id firstname的dom对象。

如果要直接访问value属性,则需要通过集合中的第一个dom对象或jquery方法val进行访问。

// Use the jQuery val function
console.log ($("#FirstName").val());

// Or get the first element and look at the value property
console.log ($("#FirstName")[0].value);

console.log(document.getElementById('FirstName').value);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<input type="text" id="FirstName" class="TabInput" value="'. $ListRow[3] . '">