/    Sign up×
Community /Pin to ProfileBookmark

Div updates JavaScript question?

Okay, I use Sublime Text 3, tried using the Find & Replace tool, apparently everytime I type in (using copy & paste), it can never find the text so that I can replace it, I checked to make sure I was looking in the right folder and everything.

So anyways, I’m trying to edit a site template that I downloaded, it includes some sidebar items, intended for updates and stuff. Here’s the code,

[CODE]<div class=”sidebar_item”>
<h2>Updates</h2>
<h3>June 3, 2017</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque cursus tempor enim.</p>
</div><!–close sidebar_item–>
</div><!–close sidebar–>
<div class=”sidebar”>
<div class=”sidebar_item”>
<h3>February 2013</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque cursus tempor enim.</p>
</div><!–close sidebar_item–>
</div><!–close sidebar–>
<div class=”sidebar”>
<div class=”sidebar_item”>
<h3>January 2013</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque cursus tempor enim.</p>
</div><!–close sidebar_item–> [/CODE]

I’m just a pure beginner in JavaScript, and have been confused. Since the Find & Replace tool couldn’t do the job, I’ve been trying to resort to DOM with JavaScript to achieve it, but haven’t had much luck.

My goal, is to each <h3> to a different date, and each <p> to a different update. But I want the updated content to be the same across all pages.

Can anyone help me out with a DOM JavaScript code to achieve this? Or should I…go and edit each page?

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@rootJun 05.2017 — IDK what sublime text 3 is like but if something isn't working you first need to look at the online documentation, if you are sure that you are doing it properly and following the instructions then raise the issue as a bug in their site.

I use Notepad++ and have done for many years, find it has all the features needed and the find & replace feature allows use of regular expressions for part matches...
×

Success!

Help @Cossack944 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...